Skip to content

Showing an additional usage line for forced commands #526

Answered by DannyBen
codevogel asked this question in Q&A
Discussion options

You must be logged in to vote

I have implemented both features in #529 and #530

Default commands will now show differently on error

# Before
$ ./cli src
missing required argument: TARGET
usage: cli download SOURCE TARGET

# After
$ ./cli src
missing required argument: TARGET
usage: cli [download] SOURCE TARGET

Examples may be optionally shown on error:

$ ./cli
missing required argument: SOURCE
usage: cli [download] SOURCE TARGET [OPTIONS]
examples:
  cli download example.com
  cli download example.com ./output -f

New settings:

# settings.yml
show_examples_on_error: true

# strings.yml
examples_caption_on_error: 'examples:'

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@codevogel
Comment options

Comment options

You must be logged in to vote
2 replies
@DannyBen
Comment options

@codevogel
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by DannyBen
Comment options

You must be logged in to vote
1 reply
@codevogel
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants