Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On bundler, we have some commands with quite complicated synopsis. For example,
bundle update
, which has different valid combinations of arguments and command line flags, pretty hard to express on a single usage line without making it look like an understandable mess.Instead, I would like to be able to specify multiple synopsis, so that
thor
would give a error of the following type when an invalid command line is specified:In general, this is useful for mutually exclusive combinations of flags and arguments.
This is explained in http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html, bullet point 8, and it's a technique used by many CLI utils.
For example, the following is the beginning of the man's man page:
This commit implements support for this kind of synopsis, by allowing passing an array of "usages" instead of a single one.