-
Notifications
You must be signed in to change notification settings - Fork 242
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
Define optional argument with exactly 1 value, + default value #339
Comments
|
command.add_argument("--format3")
.default_value(string("jpg"))
.required()
.help("Image format r [jpg|png]");
|
command.add_argument("--format1")
.default_value(string("jpg"))
.help("Image format [jpg|png]");
command.add_argument("--format2")
.required()
.help("Image format [jpg|png]");
command.add_argument("--format3")
.required()
.help("Image format [jpg|png]");
command.add_argument("--format4")
.default_value(string("jpg"))
.help("Image format [jpg|png]"); |
@nmoreaud, |
@p-ranav, |
Hello |
Hello,
I try to define an optional parameter with a value + default value, but it doesn't work as I expect.
I use version 3.0.
What I'd like to obtain:
Usage: [--format1 VAR] --format2 VAR --format3 VAR [--format4 VAR]
ok for
format1
andformat4
--format2
and--format3
[nargs=0..1]
in argument section:[required]
in argument section: ok for allCould you help me?
Here is a sample program:
The text was updated successfully, but these errors were encountered: