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
since 1aa91e7argparse:format_help/1 will crash when its Options contain a 'hidden' command.
invocation of argparse:run/3 with a 'hidden' command in Args will -- when argparse:parse/3 fails -- print the error and then an exception message (instead of the related help).
To Reproduce
Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns] [dtrace] [sharing-preserving]
Eshell V15.1.2 (press Ctrl+G to abort, type help(). for help)
1> Cmd = #{commands => #{"foo" => #{help => hidden, arguments => [#{name => x, help => "the X", type => integer}]}}}.
#{commands =>
#{"foo" =>
#{arguments => [#{name => x,type => integer,help => "the X"}],
help => hidden}}}
2> argparse:run(["foo", "NaN"], Cmd, #{}).
error: erl foo: invalid argument for x: NaN is not an integer
** exception error: bad generator hidden
in function argparse:'-format_help/2-lc$^1/1-1-'/3 (argparse.erl, line 1652)
in call from argparse:format_help/2 (argparse.erl, line 1652)
in call from argparse:run/3 (argparse.erl, line 782)
3>
Expected behavior
Erlang/OTP 26 [erts-14.2.5.4] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns] [dtrace] [sharing-preserving]
Eshell V14.2.5.4 (press Ctrl+G to abort, type help(). for help)
1> Cmd = #{commands => #{"foo" => #{help => hidden, arguments => [#{name => x, help => "the X", type => integer}]}}}.
#{commands =>
#{"foo" =>
#{arguments => [#{name => x,type => integer,help => "the X"}],
help => hidden}}}
2> argparse:run(["foo", "NaN"], Cmd, #{}).
error: erl foo: invalid argument for x: NaN is not an integer
Usage:
erl foo <x>
Arguments:
x the X (int)
Describe the bug
since 1aa91e7
argparse:format_help/1
will crash when itsOptions
contain a'hidden'
command.invocation of
argparse:run/3
with a'hidden'
command inArgs
will -- whenargparse:parse/3
fails -- print the error and then an exception message (instead of the related help).To Reproduce
Expected behavior
Affected versions
OTP-27.1.3
OTP-27.1.2
OTP-27.1.1
OTP-27.1
The text was updated successfully, but these errors were encountered: