Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(args): check version subcommand for version info #8

Merged
merged 3 commits into from Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -24,7 +24,7 @@
If you deal with command-line tools often, it might take some time to figure out how to get help or check the version of a particular command (especially when shell completions are not available). In that case, you might try the most-known flags such as `-h` and `-v` but unfortunately not all the command-line tools follow these conventions (either due to conflicts with other flags or they just use another form). Instead of _brute-forcing_ manually into getting help, you can run `halp <command>` and it will check the following arguments for you:

- for **help**: `-h`, `--help`, `help`, `-H`
- for **version info**: `-v`, `-V`, `--version`
- for **version info**: `-v`, `-V`, `--version`, `version`

If one of these arguments succeeds (with exit code 0), it prints the output and exits. This way, you can get informed about the version and help in one single command. You can also customize this list with a configuration file or provide a list of arguments via command-line arguments.

Expand Down
1 change: 1 addition & 0 deletions src/helper/args/common.rs
Expand Up @@ -40,6 +40,7 @@ generate_argument!(
Version => "-v",
CapitalVersion => "-V",
LongVersion => "--version",
SubcommandVersion => "version",
);

generate_argument!(
Expand Down