-
Say I have a bashly script In my
if I then run
This could be somewhat confusing to a new user, as they have just done So, it would be nice if it instead printed
I don't see how I could achieve this with one of the I tried looking at adding a What would be the best way to enable this? (An alternative way to render this would be something like)
or
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
Good point. I also see another problem, running Right now I am thinking that the usage pattern displayed in the error message (and possibly in other places) is:
I will look into changing it. |
Beta Was this translation helpful? Give feedback.
-
I have created #527 to track it. You may want to subscribe to the issue, I hope to have something soon. |
Beta Was this translation helpful? Give feedback.
-
It could be an adjacent feature to add an option that, along with the incorrect usage message, prints the examples for the relevant command after the incorrectly using it. That would allow you to show that they're tied together. That probably isn't enough to cover all scenarios (like for when you don't want to print the examples), but it would be pretty neat.
|
Beta Was this translation helpful? Give feedback.
-
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:' |
Beta Was this translation helpful? Give feedback.
-
@codevogel can you test the edge / master version before I release? |
Beta Was this translation helpful? Give feedback.
I have implemented both features in #529 and #530
Default commands will now show differently on error
Examples may be optionally shown on error:
New settings: