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

cli:run_options/0 is not a subtype of argparse:parser_options/0 #43

Open
zerth opened this issue Jul 11, 2022 · 0 comments
Open

cli:run_options/0 is not a subtype of argparse:parser_options/0 #43

zerth opened this issue Jul 11, 2022 · 0 comments

Comments

@zerth
Copy link

zerth commented Jul 11, 2022

cli:run/2 accepts a run_options() which is later passed directly to functions of argparse expecting a parser_options(). This leads to dialyzer errors when passing keys which are only allowed in run_options(); e.g., error.

Dialyzing the calc example app amended to include the following (in a thingy.erl module):

main(Args) ->
    cli:run(Args, #{error => error, progname => "calc"}).

results in:

thingy.erl:5:1: Function main/1 has no local return
thingy.erl:6:19: The call cli:run
         (Args :: any(),
          #{error => error, progname => "calc"}) will never return since it differs in the 2nd argument from the success typing arguments:
         (any(),
          #{'error' => 'ok', _ => _})
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

1 participant