Open sebtoun opened 1 year ago
I don't know enough about argparse/gooey to know why this is, but it looks like if you change the nargs
parameter to "*"
or "?"
parameters become optional, and get positioned in the place you're expecting.
action.add_argument("folder", type=str, widget="DirChooser", nargs="?")
Are there downsides to using nargs
or having your argument categorized as optional? No idea, but at least it seems to work!
And to help a past version of myself with search terms: --
is a "double dash" or a double hyphen.
Thanks for the tip ! I ended up using
action.add_argument("--folder", type=str, widget="DirChooser")
and explicit argument groups using add_argument_group
to make arguments look like required.
Hi,
I'm trying to use Gooey with python-fire and am having trouble with required (positional) arguments. It seems that Gooey is always passing positional arguments at the end of command line after a "--" but python-fire seems to not accept this form.
Why does Gooey passes positional arguments this way and would it be possible to opt out from this behavior ?
Just to clarify my use case:
With the configuration above, Gooey generates the following command line parameters:
While python fire expects:
or
Thanks!