You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, is there any plan to support autogeneration of the negation of a boolean flag? That is, if I want to accept both --foo and --no-foo to enable and disable foo, I could write something like
s =ArgParseSettings()
@add_arg_table s begin"--foo"
action =:store_true"--no-foo"
dest_name ="foo"
action =:store_falseend
It's a nice feature to have but not entirely straightforward to implement. I'll keep it in my todo list (and will accept pull requests if someone volunteers to do it of course).
As for how to implement it, the python click way is nice, but I'm not sure of what syntax to use in case one wants to have multiple choices (e.g. both a short and a long option, like "-f", "--foo"). It would be better IMO to have a separator after which the negated versions are provided, for example:
@add_arg_table s begin"-f", "-foo"/"-n", "--no-foo"
action =:store_trueend
This requires a bit of work on the parsing, but it's probably doable. The harder part would then be to figure out what to do for the add_arg_table function.
Hi, is there any plan to support autogeneration of the negation of a boolean flag? That is, if I want to accept both
--foo
and--no-foo
to enable and disablefoo
, I could write something likeBut it would be nice to have a shorthand. Here's how python click does it, for example: http://click.pocoo.org/5/options/#boolean-flags
CC @janzill
The text was updated successfully, but these errors were encountered: