-
Notifications
You must be signed in to change notification settings - Fork 82
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
Generate optstrings automatically #864
base: main
Are you sure you want to change the base?
Changes from 1 commit
ab3bad8
39aa97f
8150d6d
b387d6d
418a2c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -294,7 +294,7 @@ cli_list_db_getopts(int argc, char **argv) | |
exit(EXIT_CODE_BAD_ARGS); | ||
} | ||
|
||
const char *optstring = "S:D:s:t:F:xPL:u:k:mfyarJRIN:Vdzvqh"; | ||
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. We should not have 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. That is something that this PR is fixing, right? 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. Yes. I should have made myself clear. I wanted to document the human errors when maintaining optstring values by hand. This bug will not be possible after we start generating the optstring values programmatically. |
||
const char *optstring = construct_optstring(long_options); | ||
|
||
while ((c = getopt_long(argc, argv, optstring, | ||
long_options, &option_index)) != -1) | ||
|
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.
We should have
N:
as snapshot has a required argument.{ "snapshot", required_argument, NULL, 'N' }
I wonder if this means we never supported
pgcopydb dump schema --snapshot <snapshot_id>
properly.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.
I see. Can we include a fix for the argument parsing in this PR then?
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.
Once we programmatically create the optstring values, it will fix this underlying issue as well.
This bug only exists in the line that I want to remove.