feat(doc): Fix many typos in docs, comments and codes found by typos-cli

This commit is contained in:
rhysd 2021-10-19 10:38:22 +09:00
parent 693fae5090
commit 012f318c97
22 changed files with 58 additions and 58 deletions

View file

@ -940,7 +940,7 @@ Minimum version of Rust is now v1.13.0 (Stable)
* doesn't include the various [ARGS] [FLAGS] or [OPTIONS] if the only ones available are hidden ([7b4000af](https://github.com/kbknapp/clap-rs/commit/7b4000af97637703645c5fb2ac8bb65bd546b95b), closes [#882](https://github.com/kbknapp/clap-rs/issues/882))
* now correctly shows subcommand as required in the usage string when AppSettings::SubcommandRequiredElseHelp is used ([8f0884c1](https://github.com/kbknapp/clap-rs/commit/8f0884c1764983a49b45de52a1eddf8d721564d8))
* fixes some memory leaks when an error is detected and clap exits ([8c2dd287](https://github.com/kbknapp/clap-rs/commit/8c2dd28718262ace4ae0db98563809548e02a86b))
* fixes a trait that's marked private accidentlly, but should be crate internal public ([1ae21108](https://github.com/kbknapp/clap-rs/commit/1ae21108015cea87e5360402e1747025116c7878))
* fixes a trait that's marked private accidentally, but should be crate internal public ([1ae21108](https://github.com/kbknapp/clap-rs/commit/1ae21108015cea87e5360402e1747025116c7878))
* **Completions:** fixes a bug that tried to propagate global args multiple times when generating multiple completion scripts ([5e9b9cf4](https://github.com/kbknapp/clap-rs/commit/5e9b9cf4dd80fa66a624374fd04e6545635c1f94), closes [#846](https://github.com/kbknapp/clap-rs/issues/846))
#### Features
@ -1718,7 +1718,7 @@ Minimum version of Rust is now v1.13.0 (Stable)
#### Bug Fixes
* **Required Args:** fixes issue where missing required args are sometimes duplicatd in error messages ([3beebd81](https://github.com/kbknapp/clap-rs/commit/3beebd81e7bc2faa4115ac109cf570e512c5477f), closes [#492](https://github.com/kbknapp/clap-rs/issues/492))
* **Required Args:** fixes issue where missing required args are sometimes duplicated in error messages ([3beebd81](https://github.com/kbknapp/clap-rs/commit/3beebd81e7bc2faa4115ac109cf570e512c5477f), closes [#492](https://github.com/kbknapp/clap-rs/issues/492))
<a name="v2.3.0"></a>
@ -1854,7 +1854,7 @@ Minimum version of Rust is now v1.13.0 (Stable)
#### Features
* **Defult Values:** adds support for default values in args ([73211952](https://github.com/kbknapp/clap-rs/commit/73211952964a79d97b434dd567e6d7d34be7feb5), closes [#418](https://github.com/kbknapp/clap-rs/issues/418))
* **Default Values:** adds support for default values in args ([73211952](https://github.com/kbknapp/clap-rs/commit/73211952964a79d97b434dd567e6d7d34be7feb5), closes [#418](https://github.com/kbknapp/clap-rs/issues/418))
#### Documentation
@ -2213,7 +2213,7 @@ Minimum version of Rust is now v1.13.0 (Stable)
#### Features
* **Unicode:** allows non-panicing on invalid unicode characters ([c5bf7ddc](https://github.com/kbknapp/clap-rs/commit/c5bf7ddc8cfb876ec928a5aaf5591232bbb32e5d))
* **Unicode:** allows non-panicking on invalid unicode characters ([c5bf7ddc](https://github.com/kbknapp/clap-rs/commit/c5bf7ddc8cfb876ec928a5aaf5591232bbb32e5d))
#### Documentation
@ -2256,7 +2256,7 @@ Minimum version of Rust is now v1.13.0 (Stable)
#### Features
* adds abiltiy not consume self when parsing matches and/or exit on help ([94003db4](https://github.com/kbknapp/clap-rs/commit/94003db4b5eebe552ca337521c1c001295822745))
* adds ability not consume self when parsing matches and/or exit on help ([94003db4](https://github.com/kbknapp/clap-rs/commit/94003db4b5eebe552ca337521c1c001295822745))
* **App:** Added ability for users to handle errors themselves ([934e6fbb](https://github.com/kbknapp/clap-rs/commit/934e6fbb643b2385efc23444fe6fce31494dc288))

View file

@ -8,4 +8,4 @@ timeout_sec = 7200
prerun_timeout_sec = 7200
delete_merged_branches = true
cut_body_after = ""
block_lables = ["M: blocked", "M: require changes"]
block_labels = ["M: blocked", "M: require changes"]

View file

@ -155,7 +155,7 @@
"min_values": {
"type": "integer"
},
"multiple_occurences": {
"multiple_occurrences": {
"type": "boolean"
},
"multiple_values": {

View file

@ -132,7 +132,7 @@ Opt {
## clap_derive rustc version policy
- Minimum rustc version modification must be specified in the [changelog](https://github.com/clap-rs/clap_derive/blob/master/CHANGELOG.md) and in the [travis configuration](https://github.com/clap-rs/clap_derive/blob/master/.travis.yaml).
- Contributors can increment minimum rustc version without any justification if the new version is required by the latest version of one of clap_derive's depedencies (`cargo update` will not fail on clap_derive).
- Contributors can increment minimum rustc version without any justification if the new version is required by the latest version of one of clap_derive's dependencies (`cargo update` will not fail on clap_derive).
- Contributors can increment minimum rustc version if the library user experience is improved.
## Why

View file

@ -138,7 +138,7 @@ fn variant_with_defined_casing() {
}
#[test]
fn casing_is_propogated_from_parent() {
fn casing_is_propagated_from_parent() {
#[derive(ArgEnum, PartialEq, Debug, Clone)]
#[clap(rename_all = "screaming_snake")]
enum ArgChoice {
@ -161,7 +161,7 @@ fn casing_is_propogated_from_parent() {
}
#[test]
fn casing_propogation_is_overridden() {
fn casing_propagation_is_overridden() {
#[derive(ArgEnum, PartialEq, Debug, Clone)]
#[clap(rename_all = "screaming_snake")]
enum ArgChoice {

View file

@ -37,10 +37,10 @@ fn overridable() {
be_nice: String,
#[clap(rename_all_env = "pascal", env)]
be_agressive: String,
be_aggressive: String,
}
let help = get_help::<BehaviorModel>();
assert!(help.contains("[env: be-nice=]"));
assert!(help.contains("[env: BeAgressive=]"));
assert!(help.contains("[env: BeAggressive=]"));
}

View file

@ -125,7 +125,7 @@ fn build_app_special_commands() -> App<'static> {
.about("the other case to test"),
),
)
.subcommand(App::new("some-cmd-with-hypens").alias("hyphen"))
.subcommand(App::new("some-cmd-with-hyphens").alias("hyphen"))
}
static BASH_SPECIAL_CMDS: &str = r#"_my_app() {
@ -145,8 +145,8 @@ static BASH_SPECIAL_CMDS: &str = r#"_my_app() {
help)
cmd+="__help"
;;
some-cmd-with-hypens)
cmd+="__some__cmd__with__hypens"
some-cmd-with-hyphens)
cmd+="__some__cmd__with__hyphens"
;;
some_cmd)
cmd+="__some_cmd"
@ -161,7 +161,7 @@ static BASH_SPECIAL_CMDS: &str = r#"_my_app() {
case "${cmd}" in
my_app)
opts="-h -V --help --version <file> first second test some_cmd some-cmd-with-hypens help"
opts="-h -V --help --version <file> first second test some_cmd some-cmd-with-hyphens help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@ -188,7 +188,7 @@ static BASH_SPECIAL_CMDS: &str = r#"_my_app() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
my_app__some__cmd__with__hypens)
my_app__some__cmd__with__hyphens)
opts="-h -V --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )

View file

@ -89,7 +89,7 @@ fn build_app_special_commands() -> App<'static> {
.about("the other case to test"),
),
)
.subcommand(App::new("some-cmd-with-hypens").alias("hyphen"))
.subcommand(App::new("some-cmd-with-hyphens").alias("hyphen"))
}
static ELVISH_SPECIAL_CMDS: &str = r#"
@ -118,7 +118,7 @@ set edit:completion:arg-completer[my_app] = [@words]{
cand --version 'Print version information'
cand test 'tests things'
cand some_cmd 'tests other things'
cand some-cmd-with-hypens 'some-cmd-with-hypens'
cand some-cmd-with-hyphens 'some-cmd-with-hyphens'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'my_app;test'= {
@ -135,7 +135,7 @@ set edit:completion:arg-completer[my_app] = [@words]{
cand -V 'Print version information'
cand --version 'Print version information'
}
&'my_app;some-cmd-with-hypens'= {
&'my_app;some-cmd-with-hyphens'= {
cand -h 'Print help information'
cand --help 'Print help information'
cand -V 'Print version information'

View file

@ -56,14 +56,14 @@ fn build_app_special_commands() -> App<'static> {
.about("the other case to test"),
),
)
.subcommand(App::new("some-cmd-with-hypens").alias("hyphen"))
.subcommand(App::new("some-cmd-with-hyphens").alias("hyphen"))
}
static FISH_SPECIAL_CMDS: &str = r#"complete -c my_app -n "__fish_use_subcommand" -s h -l help -d 'Print help information'
complete -c my_app -n "__fish_use_subcommand" -s V -l version -d 'Print version information'
complete -c my_app -n "__fish_use_subcommand" -f -a "test" -d 'tests things'
complete -c my_app -n "__fish_use_subcommand" -f -a "some_cmd" -d 'tests other things'
complete -c my_app -n "__fish_use_subcommand" -f -a "some-cmd-with-hypens"
complete -c my_app -n "__fish_use_subcommand" -f -a "some-cmd-with-hyphens"
complete -c my_app -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c my_app -n "__fish_seen_subcommand_from test" -l case -d 'the case to test' -r
complete -c my_app -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help information'
@ -71,8 +71,8 @@ complete -c my_app -n "__fish_seen_subcommand_from test" -s V -l version -d 'Pri
complete -c my_app -n "__fish_seen_subcommand_from some_cmd" -l config -d 'the other case to test' -r
complete -c my_app -n "__fish_seen_subcommand_from some_cmd" -s h -l help -d 'Print help information'
complete -c my_app -n "__fish_seen_subcommand_from some_cmd" -s V -l version -d 'Print version information'
complete -c my_app -n "__fish_seen_subcommand_from some-cmd-with-hypens" -s h -l help -d 'Print help information'
complete -c my_app -n "__fish_seen_subcommand_from some-cmd-with-hypens" -s V -l version -d 'Print version information'
complete -c my_app -n "__fish_seen_subcommand_from some-cmd-with-hyphens" -s h -l help -d 'Print help information'
complete -c my_app -n "__fish_seen_subcommand_from some-cmd-with-hyphens" -s V -l version -d 'Print version information'
complete -c my_app -n "__fish_seen_subcommand_from help" -s h -l help -d 'Print help information'
"#;

View file

@ -108,7 +108,7 @@ fn build_app_special_commands() -> App<'static> {
.about("the other case to test"),
),
)
.subcommand(App::new("some-cmd-with-hypens").alias("hyphen"))
.subcommand(App::new("some-cmd-with-hyphens").alias("hyphen"))
}
static POWERSHELL_SPECIAL_CMDS: &str = r#"
@ -143,7 +143,7 @@ Register-ArgumentCompleter -Native -CommandName 'my_app' -ScriptBlock {
[CompletionResult]::new('--conf', 'conf', [CompletionResultType]::ParameterName, 'some config file')
[CompletionResult]::new('test', 'test', [CompletionResultType]::ParameterValue, 'tests things')
[CompletionResult]::new('some_cmd', 'some_cmd', [CompletionResultType]::ParameterValue, 'tests other things')
[CompletionResult]::new('some-cmd-with-hypens', 'some-cmd-with-hypens', [CompletionResultType]::ParameterValue, 'some-cmd-with-hypens')
[CompletionResult]::new('some-cmd-with-hyphens', 'some-cmd-with-hyphens', [CompletionResultType]::ParameterValue, 'some-cmd-with-hyphens')
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
break
}
@ -163,7 +163,7 @@ Register-ArgumentCompleter -Native -CommandName 'my_app' -ScriptBlock {
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
break
}
'my_app;some-cmd-with-hypens' {
'my_app;some-cmd-with-hyphens' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')

View file

@ -104,7 +104,7 @@ fn build_app_special_commands() -> App<'static> {
.about("the other case to test"),
),
)
.subcommand(App::new("some-cmd-with-hypens").alias("hyphen"))
.subcommand(App::new("some-cmd-with-hyphens").alias("hyphen"))
}
static FIG_SPECIAL_CMDS: &str = r#"const completion: Fig.Spec = {
@ -156,7 +156,7 @@ static FIG_SPECIAL_CMDS: &str = r#"const completion: Fig.Spec = {
],
},
{
name: "some-cmd-with-hypens",
name: "some-cmd-with-hyphens",
options: [
{
name: ["-h", "--help"],

View file

@ -42,7 +42,7 @@ pub fn runner() -> Runner {
&[
["DisableHelpFlags", "DisableHelpFlag"],
["DisableVersion", "DisableVersionFlag"],
// @TODO @v3 shoud be removed, not renamed
// @TODO @v3 should be removed, not renamed
["VersionlessSubcommands", "DisableVersionForSubcommands"],
],
)

View file

@ -75,7 +75,7 @@ fn main() {
println!("A config file was passed in: {}", config);
}
// Let's print the <INPUT> file the user passed in. We can use .unwrap() here becase the arg is
// Let's print the <INPUT> file the user passed in. We can use .unwrap() here because the arg is
// required, and parsing would have failed if the user forgot it
println!("Using input file: {}", matches.value_of("input").unwrap());

View file

@ -22,7 +22,7 @@ fn main() {
// Next we'll use the Option::unwrap_or method on this "CONFIG" option
.arg(
Arg::new("CONFIG")
// Note that we have to manaully include some verbage to the user
// Note that we have to manually include some verbage to the user
// telling them what the default will be.
.about("The config file to use (default is \"config.json\")")
.short('c')

View file

@ -2032,7 +2032,7 @@ impl<'help> Arg<'help> {
///
/// **NOTE:** This setting only applies to [options] and [positional arguments]
///
/// **NOTE:** You can use both strings directly or use [`ArgValue`] if you want more controll
/// **NOTE:** You can use both strings directly or use [`ArgValue`] if you want more control
/// over single possible values.
///
/// # Examples
@ -3739,7 +3739,7 @@ impl<'help> Arg<'help> {
/// # ;
/// ```
///
/// For example, assume an appliction with two subcommands, and you'd like to define a
/// For example, assume an application with two subcommands, and you'd like to define a
/// `--verbose` flag that can be called on any of the subcommands and parent, but you don't
/// want to clutter the source with three duplicate [`Arg`] definitions.
///

View file

@ -1,7 +1,7 @@
use super::{settings::ArgSettings, Arg};
#[test]
fn short_flag_misspel() {
fn short_flag_misspell() {
let a = Arg::from("-f1, --flag 'some flag'");
assert_eq!(a.name, "flag");
assert_eq!(a.short.unwrap(), 'f');

View file

@ -66,8 +66,8 @@ impl<'help, 'app, 'parser> Usage<'help, 'app, 'parser> {
usage.push_str(" [OPTIONS]");
}
let allow_mising_positional = self.p.app.is_set(AS::AllowMissingPositional);
if !allow_mising_positional {
let allow_missing_positional = self.p.app.is_set(AS::AllowMissingPositional);
if !allow_missing_positional {
usage.push_str(&req_string);
}
@ -135,7 +135,7 @@ impl<'help, 'app, 'parser> Usage<'help, 'app, 'parser> {
}
}
if allow_mising_positional {
if allow_missing_positional {
usage.push_str(&req_string);
}

View file

@ -126,7 +126,7 @@ pub enum ErrorKind {
/// ```
EmptyValue,
/// Occurs when the user doesn't use equals for an option that requres equal
/// Occurs when the user doesn't use equals for an option that requires equal
/// sign to provide values.
///
/// ```rust

View file

@ -628,8 +628,8 @@ impl ArgMatches {
/// .short('o')
/// .takes_value(true))
/// .get_matches_from(vec!["myapp", "-f", "-o", "val"]);
/// // ARGV idices: ^0 ^1 ^2 ^3
/// // clap idices: ^1 ^3
/// // ARGV indices: ^0 ^1 ^2 ^3
/// // clap indices: ^1 ^3
///
/// assert_eq!(m.index_of("flag"), Some(1));
/// assert_eq!(m.index_of("option"), Some(3));
@ -646,8 +646,8 @@ impl ArgMatches {
/// .short('o')
/// .takes_value(true))
/// .get_matches_from(vec!["myapp", "-f", "-o=val"]);
/// // ARGV idices: ^0 ^1 ^2
/// // clap idices: ^1 ^3
/// // ARGV indices: ^0 ^1 ^2
/// // clap indices: ^1 ^3
///
/// assert_eq!(m.index_of("flag"), Some(1));
/// assert_eq!(m.index_of("option"), Some(3));
@ -669,8 +669,8 @@ impl ArgMatches {
/// .short('o')
/// .takes_value(true))
/// .get_matches_from(vec!["myapp", "-fzF", "-oval"]);
/// // ARGV idices: ^0 ^1 ^2
/// // clap idices: ^1,2,3 ^5
/// // ARGV indices: ^0 ^1 ^2
/// // clap indices: ^1,2,3 ^5
/// //
/// // clap sees the above as 'myapp -f -z -F -o val'
/// // ^0 ^1 ^2 ^3 ^4 ^5
@ -695,8 +695,8 @@ impl ArgMatches {
/// .short('o')
/// .takes_value(true))
/// .get_matches_from(vec!["myapp", "-fzFoval"]);
/// // ARGV idices: ^0 ^1
/// // clap idices: ^1,2,3^5
/// // ARGV indices: ^0 ^1
/// // clap indices: ^1,2,3^5
/// //
/// // clap sees the above as 'myapp -f -z -F -o val'
/// // ^0 ^1 ^2 ^3 ^4 ^5
@ -716,8 +716,8 @@ impl ArgMatches {
/// .use_delimiter(true)
/// .multiple_values(true))
/// .get_matches_from(vec!["myapp", "-o=val1,val2,val3"]);
/// // ARGV idices: ^0 ^1
/// // clap idices: ^2 ^3 ^4
/// // ARGV indices: ^0 ^1
/// // clap indices: ^2 ^3 ^4
/// //
/// // clap sees the above as 'myapp -o val1 val2 val3'
/// // ^0 ^1 ^2 ^3 ^4
@ -755,8 +755,8 @@ impl ArgMatches {
/// .use_delimiter(true)
/// .multiple_values(true))
/// .get_matches_from(vec!["myapp", "-o=val1,val2,val3"]);
/// // ARGV idices: ^0 ^1
/// // clap idices: ^2 ^3 ^4
/// // ARGV indices: ^0 ^1
/// // clap indices: ^2 ^3 ^4
/// //
/// // clap sees the above as 'myapp -o val1 val2 val3'
/// // ^0 ^1 ^2 ^3 ^4
@ -776,8 +776,8 @@ impl ArgMatches {
/// .short('f')
/// .multiple_occurrences(true))
/// .get_matches_from(vec!["myapp", "-o", "val1", "-f", "-o", "val2", "-f"]);
/// // ARGV idices: ^0 ^1 ^2 ^3 ^4 ^5 ^6
/// // clap idices: ^2 ^3 ^5 ^6
/// // ARGV indices: ^0 ^1 ^2 ^3 ^4 ^5 ^6
/// // clap indices: ^2 ^3 ^5 ^6
///
/// assert_eq!(m.indices_of("option").unwrap().collect::<Vec<_>>(), &[2, 5]);
/// assert_eq!(m.indices_of("flag").unwrap().collect::<Vec<_>>(), &[3, 6]);
@ -796,8 +796,8 @@ impl ArgMatches {
/// .takes_value(true)
/// .multiple_values(true))
/// .get_matches_from(vec!["myapp", "-o=val1,val2,val3"]);
/// // ARGV idices: ^0 ^1
/// // clap idices: ^2
/// // ARGV indices: ^0 ^1
/// // clap indices: ^2
/// //
/// // clap sees the above as 'myapp -o "val1,val2,val3"'
/// // ^0 ^1 ^2

View file

@ -665,7 +665,7 @@ impl<'help, 'app> Parser<'help, 'app> {
self.seen.push(p.id.clone());
// Creating new value group rather than appending when the arg
// doesn't have any value. This behaviour is right because
// positional arguments are always present continiously.
// positional arguments are always present continuously.
let append = self.arg_have_val(matcher, p);
self.add_val_to_arg(
p,

View file

@ -410,7 +410,7 @@ fn group_macro_multiple_methods_alternative() {
}
#[test]
fn group_macro_multiple_invokations() {
fn group_macro_multiple_invocations() {
#![allow(deprecated)]
let app = clap::clap_app!(claptests =>
(version: "0.1")

View file

@ -65,7 +65,7 @@ fn multiple_occurrences_of_flags_large_quantity() {
.into_iter()
.chain(vec!["-m"; 1024].into_iter())
.collect();
let m = App::new("mo_flags_larg_qty")
let m = App::new("mo_flags_large_qty")
.arg(
Arg::from("-m --multflag 'allowed multiple flag'")
.setting(ArgSettings::MultipleOccurrences),