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
Change default help and version message to infinitive form #2500
Comments
|
# mut_arg("-h", |a| a.about("help info"))
USAGE:
app [-h] <SUBCOMMAND>
ARGS:
<-h> help info
FLAGS:
-h, --help Prints help information
-V, --version Prints version information # mut_arg("--help", |a| a.about("help info"))
USAGE:
zoxide [--help] <SUBCOMMAND>
ARGS:
<--help> help info
FLAGS:
-h, --help Prints help information
-V, --version Prints version information # mut_arg("help", |a| a.about("help info"))
error: Found argument '-h' which wasn't expected, or isn't valid in this context
If you tried to supply `-h` as a PATTERN use `-- -h`
USAGE:
zoxide [help] <SUBCOMMAND> |
1. Yes.
2. Try master
…On Thu, May 27, 2021, 06:44 ajeetdsouza ***@***.***> wrote:
1. Would you be open to accepting a PR to change the default string?
2. Perhaps I'm doing something wrong, but I wasn't able to get this
working. I'm using this on a struct with
AppSettings::DisableHelpSubcommand and I ran it with cargo run -- -h:
# mut_arg("-h", |a| a.about("help info"))
USAGE:
app [-h] <SUBCOMMAND>
ARGS:
<-h> help info
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
# mut_arg("--help", |a| a.about("help info"))
USAGE:
zoxide [--help] <SUBCOMMAND>
ARGS:
<--help> help info
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
# mut_arg("help", |a| a.about("help info"))
error: Found argument '-h' which wasn't expected, or isn't valid in this context
If you tried to supply `-h` as a PATTERN use `-- -h`
USAGE:
zoxide [help] <SUBCOMMAND>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2500 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABKU36F4BU5SUEMW2RNIZDTPXL5VANCNFSM45SW3DKA>
.
|
|
Make sure that you save without formatting the |
I did save without formatting, and then I disabled removing trailing whitespaces in the settings, but VS Code simply refused to stop formatting the line. It's probably a bug. I resorted to just using sed -i 's/Prints version information/Print version information/g' **/*.*
sed -i 's/Prints help information/Print help information/g' **/*.*
sed -i 's/Prints this message or the help of the given subcommand/Print this message or the help of the given subcommand/g' **/*.* Now, a lot more tests pass, but a few are still failing due to whitespace issues. I switched to |
As I said, We have an issue with no version printing blank space that's being tracked. If you change only the messages without any whitespace changes, it should be fixed. |
Please complete the following tasks
Describe your use case
There are two problems here.
clap
uses an unconventional sentence form in its auto-generated help messages (i.e."Prints a help message"
vs"Print a help message"
). A lot of users (as shown in the links above) would like to change this, because practically every other UNIX program shows it in the infinitive form:clap_derive
.Describe the solution you'd like
I'd like a way to set
global_help_message
andglobal_version_message
in my app.Alternatives, if applicable
app.mut_arg("help", |a| a.about("help info"))
is a solution, but it does not work for apps usingclap_derive
.Additional Context
There's plenty of demand for this feature:
The text was updated successfully, but these errors were encountered: