canonical / craft-cli

Home Page:https://canonical-craft-cli.readthedocs-hosted.com/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better output information when requesting help for a command with bad arguments for that command

facundobatista opened this issue · comments

It's typical the following situation: Try to run a command with bad args...

myapp somecommand --bad-args

...and then, when failed, ask for help on that:

myapp help somecommand --bad-args

Currently it fails because --bad-args is not really a valid argument for the help command. Real life example:

$ charmcraft help close --bad-args
Usage: charmcraft [options] command [args]...
Try 'charmcraft -h' for help.

Error: Too many parameters when requesting help; pass a command, '--all', or leave it empty

It should detect that the first given parameter is actually a command name, and it should provide help for that command, no matter the invalid posterior options. Expected:

$ charmcraft help close --bad-args
Usage:
    charmcraft close [options] <name> <channel>

Summary:
    ...

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3415.

This message was autogenerated