Skip to content

Can the usage string itself be modified according to constraints? #79

Answered by janluke
thomas-schweich asked this question in Q&A

You must be logged in to vote

Thank you for the nice words in the beginning. Let me clarify that this is not a fork, it's more something in between a set of integrated Click "extensions" and a Click wrapper.

Coming to your question, I've never customized the usage string myself. I think that in case of commands with many options, it's quite pointless to generate an exhaustive usage string: a better alternative is to provide usage examples in the command help text and those should probably be manually written.

For simple commands, you may consider to use the options_metavar argument of command and manually specify what you want to see in place of the default [OPTIONS]. Of course, this is not ideal.

To make everything a…

Replies: 1 comment 3 replies

You must be logged in to vote
3 replies
@thomas-schweich

@janluke

@janluke

Answer selected by thomas-schweich
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