Skip to content
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

Required argument listed as optional in arg table for command #122

Closed
cpaniaguam opened this issue May 10, 2023 · 1 comment
Closed

Required argument listed as optional in arg table for command #122

cpaniaguam opened this issue May 10, 2023 · 1 comment

Comments

@cpaniaguam
Copy link

julia> using ArgParse

julia> settings = ArgParseSettings();

julia> @add_arg_table! settings begin
           "cmd"
           action = :command
       end;

julia> @add_arg_table! settings["cmd"] begin
           "--opt1"
           required = true

           "--opt2"
           required = false
       end;

julia> parse_args(["cmd", "-h"], settings)
usage: <PROGRAM> cmd --opt1 OPT1 [--opt2 OPT2] [-h]

optional arguments:
  --opt1 OPT1
  --opt2 OPT2
  -h, --help   show this help message and exit
@carlobaldassi
Copy link
Owner

This is not limited to commands; the issue is actually a duplicate of #108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants