Merged
Conversation
The --help option would invoke the command then print the help message, instead of skipping the command. For example `shards update --help` would run the update command then print the help message. Since shards default to the install command when none is provided, it led "shards --help" to always run the install command then print the help. This patch fixes this issue while still allowing to pass --help to external `shard-[command]` subcommands.
Member
|
I'm not sure if the hard coded list is worth it. Ideally, every command should have its own help message. So the currently duplicated |
straight-shoota
approved these changes
Jan 20, 2025
ysbaddaden
commented
Jan 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Restores the behavior where
--helpwould always skip the command to be invoked, while still allowing to pass the--helpto external subcommands:The following commands print the help message and exit:
shards --helpshards --local --helpshards update --helpWhile the following tries to call
shards-unknown --helpthen falls back to print the help message and exit:shards unknown --helpRelies on a fixed list of the builtin command names to avoid having each
whencase starting withdisplay_help_and_exit(opts) if display_help.closes #649