Skip to content

Commit

Permalink
Merge clap-rs#2909
Browse files Browse the repository at this point in the history
2909: feat(doc): Fix many typos in docs, comments and codes found by typos-cli r=pksunkara a=rhysd



Co-authored-by: rhysd <lin90162@yahoo.co.jp>
  • Loading branch information
bors[bot] and rhysd committed Oct 19, 2021
2 parents 693fae5 + 8a7d217 commit fe29af7
Show file tree
Hide file tree
Showing 23 changed files with 85 additions and 85 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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))


Expand Down
2 changes: 1 addition & 1 deletion bors.toml
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion clap.schema.json
Expand Up @@ -155,7 +155,7 @@
"min_values": {
"type": "integer"
},
"multiple_occurences": {
"multiple_occurrences": {
"type": "boolean"
},
"multiple_values": {
Expand Down
2 changes: 1 addition & 1 deletion clap_derive/README.md
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions clap_derive/tests/arg_enum.rs
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions clap_derive/tests/rename_all_env.rs
Expand Up @@ -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=]"));
}
10 changes: 5 additions & 5 deletions clap_generate/tests/completions/bash.rs
Expand Up @@ -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() {
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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}") )
Expand Down
6 changes: 3 additions & 3 deletions clap_generate/tests/completions/elvish.rs
Expand Up @@ -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#"
Expand Down Expand Up @@ -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'= {
Expand All @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions clap_generate/tests/completions/fish.rs
Expand Up @@ -56,23 +56,23 @@ 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'
complete -c my_app -n "__fish_seen_subcommand_from test" -s V -l version -d 'Print version information'
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'
"#;

Expand Down
6 changes: 3 additions & 3 deletions clap_generate/tests/completions/powershell.rs
Expand Up @@ -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#"
Expand Down Expand Up @@ -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
}
Expand All @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions clap_generate_fig/tests/completions/fig.rs
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion clap_up/src/lib.rs
Expand Up @@ -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"],
],
)
Expand Down
2 changes: 1 addition & 1 deletion examples/03_args.rs
Expand Up @@ -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());

Expand Down
2 changes: 1 addition & 1 deletion examples/10_default_values.rs
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions src/build/arg/mod.rs
Expand Up @@ -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
Expand Down Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion src/build/arg/tests.rs
@@ -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');
Expand Down
6 changes: 3 additions & 3 deletions src/output/usage.rs
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/parse/errors.rs
Expand Up @@ -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
Expand Down

0 comments on commit fe29af7

Please sign in to comment.