-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
AVRO-4109: [C++] Remove boost::program_options #3286
base: main
Are you sure you want to change the base?
Conversation
lang/c++/impl/avrogencpp.cc
Outdated
} | ||
|
||
// Options that require a value | ||
if (i + 1 >= argc) { |
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.
This is unfortunate as providing an unknown option at the end of the argument list will produce this error rather than unknown option.
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.
Thanks for the suggestion! Fixed.
if (arg == "-U" || arg == "--no-union-typedef") { | ||
opts.noUnionTypedef = true; | ||
} else if (arg == "-p" || arg == "--include-prefix") { | ||
if (i + 1 >= argc) { |
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.
Instead of repeating the error display multiple times, we can use:
if (i + 1 < argc) {
opts.includePrefix = argv[++i];
continue;
}
And add at the end of the loop body (so that it executes if the condition is not met):
std::cerr << "Missing value for option: " << arg << std::endl;
return false;
return true; | ||
} | ||
|
||
if (arg == "-V" || arg == "--version") { |
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.
Should we also check if there are any more arguments? For example, if someone type avrogencpp -V -U
, should we just show the version or error out?
What is the purpose of the change
Remove boost::program_options
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Documentation