-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve command-line processing of gaia_db_extract #1048
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
de2561f
improve command-line processing of gaia_db_extract
waynelwarren 20a2210
addressing PR comments
waynelwarren 12fd078
Merge branch 'master' into wayne/improve-extract-main
waynelwarren 425d30c
changed c_start_string to c_start_after_string
waynelwarren 48d0125
Merge branch 'master' into wayne/improve-extract-main
waynelwarren 8621b90
reworked usage and error messages
waynelwarren b054a0c
reworking the usage text
waynelwarren 5598c1b
more usage() improvements
waynelwarren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ using namespace gaia::common; | |
using namespace gaia::tools::db_extract; | ||
using namespace std; | ||
|
||
constexpr char c_start_string[] = "start-after"; | ||
constexpr char c_start_after_string[] = "start-after"; | ||
constexpr char c_row_limit_string[] = "row-limit"; | ||
constexpr char c_database_string[] = "database"; | ||
constexpr char c_table_string[] = "table"; | ||
|
@@ -24,10 +24,10 @@ constexpr char c_table_string[] = "table"; | |
static void usage() | ||
{ | ||
cerr << "Usage: gaia_db_extract [--" << c_database_string << "=<databasename>] [--" << c_table_string << "=<tableneme>] [--" | ||
<< c_start_string << "=ID] [--" << c_row_limit_string << "=N]" << endl; | ||
<< c_start_after_string << "=ID] [--" << c_row_limit_string << "=N]" << endl; | ||
cerr << " No parameters: dump the catalog only." << endl; | ||
cerr << " Else dump rows specified by " << c_database_string << "/" << c_table_string << " name, limited by " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is unclear to me what is going on here. What is being reported? And is the message saying what it is doing or giving instructions of what to do? |
||
<< c_start_string << " and " << c_row_limit_string << "." << endl; | ||
<< c_start_after_string << " and " << c_row_limit_string << "." << endl; | ||
|
||
// Print an empty JSON object when there is any kind of error. | ||
cout << "{}" << endl; | ||
|
@@ -78,12 +78,12 @@ int main(int argc, char* argv[]) | |
// Get a parameter and value pair from the command-line. | ||
parse_arg(argc, argv, i, key, value); | ||
|
||
if (!key.compare(c_start_string)) | ||
if (!key.compare(c_start_after_string)) | ||
{ | ||
start_after = stoi(value); | ||
if (start_after < 1) | ||
{ | ||
cerr << "Illegal value for " << c_start_string << ". It must be 1 or greater." << endl; | ||
cerr << "Illegal value for " << c_start_after_string << ". It must be 1 or greater." << endl; | ||
usage(); | ||
} | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean "Extracts the entire catalog" (ie all of the contents of the database)? Or does it mean that it extracts the structure of the database? Or ...?