diff --git a/README.md b/README.md index e4f6d60cf03..42932b41c2c 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ Below are a few of the features which `clap` supports, full descriptions and usa - Optionally supports named values so that the usage/help info appears as `-o ` etc. for when you require specific multiple values - Optionally sets value parameters (such as the minimum number of values, the maximum number of values, or the exact number of values) * **Sub-Commands** (i.e. `git add ` where `add` is a sub-command of `git`) - - Support their own sub-arguments, and sub-sub-commands independant of the parent - - Get their own auto-generated Help, Version, and Usage independant of parent + - Support their own sub-arguments, and sub-sub-commands independent of the parent + - Get their own auto-generated Help, Version, and Usage independent of parent * **Requirement Rules**: Arguments can optionally define the following types of requirement rules - Required by default - Required only if certain arguments are present diff --git a/changelog.md b/changelog.md index 59d9e33cead..805e0b113c8 100644 --- a/changelog.md +++ b/changelog.md @@ -52,7 +52,7 @@ #### Improvements * **ErrorMessages** improves error messages and corrections ([a29c3983](https://github.com/kbknapp/clap-rs/commit/a29c3983c4229906655a29146ec15a0e46dd942d)) -* **ArgGroups** improves requirment and confliction support for groups ([c236dc5f](https://github.com/kbknapp/clap-rs/commit/c236dc5ff475110d2a1b80e62903f80296163ad3)) +* **ArgGroups** improves requirement and confliction support for groups ([c236dc5f](https://github.com/kbknapp/clap-rs/commit/c236dc5ff475110d2a1b80e62903f80296163ad3)) diff --git a/examples/01a_QuickExample.rs b/examples/01a_QuickExample.rs index 4786f4e7991..28e8c4cd9e5 100644 --- a/examples/01a_QuickExample.rs +++ b/examples/01a_QuickExample.rs @@ -60,7 +60,7 @@ fn main() { 3 | _ => println!("Don't be crazy"), } - // You can check for the existance of subcommands, and if found use their + // You can check for the existence of subcommands, and if found use their // matches just as you would the top level app if let Some(ref matches) = matches.subcommand_matches("test") { // "$ myapp test" was run diff --git a/examples/01b_QuickExample.rs b/examples/01b_QuickExample.rs index 1f040dabb22..115dc196464 100644 --- a/examples/01b_QuickExample.rs +++ b/examples/01b_QuickExample.rs @@ -9,7 +9,7 @@ fn main() { // // The example below is functionally identical to the one in 01a_QuickExample.rs // - // *NOTE:* You can actually acheive the best of both worlds by using Arg::from_usage() (instead of Arg::with_name()) + // *NOTE:* You can actually achieve the best of both worlds by using Arg::from_usage() (instead of Arg::with_name()) // and *then* setting any additional properties. // // Create an application with 5 possible arguments (2 auto generated) and 2 subcommands (1 auto generated) @@ -75,7 +75,7 @@ fn main() { 3 | _ => println!("Don't be crazy"), } - // You can check for the existance of subcommands, and if found use their + // You can check for the existence of subcommands, and if found use their // matches just as you would the top level app if let Some(ref matches) = matches.subcommand_matches("test") { // "$ myapp test" was run diff --git a/examples/03_Args.rs b/examples/03_Args.rs index 6ef7117d89c..21e158367aa 100644 --- a/examples/03_Args.rs +++ b/examples/03_Args.rs @@ -6,7 +6,7 @@ fn main() { // Args describe a possible valid argument which may be supplied by the user at runtime. There // are three different types of arguments (flags, options, and positional) as well as a fourth - // special type of arguement, called SubCommands (which will be discussed seperately). + // special type of argument, called SubCommands (which will be discussed separately). // // Args are described in the same manner as Apps using the "builder pattern" with multiple // methods describing various settings for the individual arguments. Or by supplying a "usage" diff --git a/examples/06_PositionalArgs.rs b/examples/06_PositionalArgs.rs index 148a7fc31fb..a08330256cf 100644 --- a/examples/06_PositionalArgs.rs +++ b/examples/06_PositionalArgs.rs @@ -4,7 +4,7 @@ use clap::{App, Arg}; fn main() { - // Positional arguments are those values after the program name which are not preceeded by any + // Positional arguments are those values after the program name which are not preceded by any // identifier (such as "myapp some_file"). Positionals support many of the same options as // flags, as well as a few additional ones. let matches = App::new("MyApp") diff --git a/examples/07_OptionArgs.rs b/examples/07_OptionArgs.rs index 268df83fe97..64240b2c737 100644 --- a/examples/07_OptionArgs.rs +++ b/examples/07_OptionArgs.rs @@ -8,7 +8,7 @@ fn main() { // support three types of specification, those with short() as "-o some", or those with long() // as "--option value" or "--option=value" // - // Options also support a multiple setting, which is dicussed in the example below. + // Options also support a multiple setting, which is discussed in the example below. let matches = App::new("MyApp") // Regular App configuration goes here... diff --git a/examples/08_SubCommands.rs b/examples/08_SubCommands.rs index 3bb42b28829..48ca59ee26a 100644 --- a/examples/08_SubCommands.rs +++ b/examples/08_SubCommands.rs @@ -27,7 +27,7 @@ fn main() { .subcommand(SubCommand::new("add") // The name we call argument with .about("Adds files to myapp") // The message displayed in "myapp -h" // or "myapp help" - .version("0.1") // Subcommands can have independant version + .version("0.1") // Subcommands can have independent version .author("Kevin K.") // And authors .arg(Arg::with_name("input") // And their own arguments .help("the file to add") @@ -40,9 +40,9 @@ fn main() { println!("'myapp add' was run."); } - // You can get the independant subcommand matches (which function exactly like App matches) + // You can get the independent subcommand matches (which function exactly like App matches) if let Some(ref matches) = matches.subcommand_matches("add") { - // Safe to use unwrap() becasue of the required() option + // Safe to use unwrap() because of the required() option println!("Adding file: {}", matches.value_of("input").unwrap()); } diff --git a/examples/12_TypedValues.rs b/examples/12_TypedValues.rs index 3e70f2dac00..15871326517 100644 --- a/examples/12_TypedValues.rs +++ b/examples/12_TypedValues.rs @@ -11,7 +11,7 @@ fn main() { // // There are also two ways in which to get types, those where failures cause the program to exit // with an error and usage string, and those which return a Result or Result,String> - // respectivly. Both methods support single and multiple values. + // respectively. Both methods support single and multiple values. // // The macro which returns a Result allows you decide what to do upon a failure, exit, provide a // default value, etc. You have control. But it also means you have to write the code or boiler plate diff --git a/src/app.rs b/src/app.rs index e7133ad09a3..73921cab568 100644 --- a/src/app.rs +++ b/src/app.rs @@ -87,7 +87,7 @@ pub struct App<'a, 'v, 'ab, 'u, 'h, 'ar> { author: Option<&'a str>, // The version displayed to the user version: Option<&'v str>, - // A brief explaination of the program that gets displayed to the user when shown help/usage + // A brief explanation of the program that gets displayed to the user when shown help/usage // information about: Option<&'ab str>, // Additional help information @@ -1557,7 +1557,7 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{ if let Some(sc_name) = subcmd_name { if let Some(ref mut sc) = self.subcommands.get_mut(&sc_name) { let mut new_matches = ArgMatches::new(); - // bin_name should be parent's bin_name + the sc's name seperated by a space + // bin_name should be parent's bin_name + the sc's name separated by a space sc.bin_name = Some(format!("{}{}{}", self.bin_name.clone().unwrap_or("".to_owned()), if self.bin_name.is_some() { diff --git a/src/args/arg.rs b/src/args/arg.rs index ebeb071f18e..b7181839499 100644 --- a/src/args/arg.rs +++ b/src/args/arg.rs @@ -98,7 +98,7 @@ impl<'n, 'l, 'h, 'g, 'p, 'r> Arg<'n, 'l, 'h, 'g, 'p, 'r> { /// and positional arguments (i.e. those without a `-` or `--`) the name will also /// be displayed when the user prints the usage/help information of the program. /// - /// **NOTE:** this function is deprecated in favor of Arg::with_name() to stay consistant with + /// **NOTE:** this function is deprecated in favor of Arg::with_name() to stay consistent with /// Rust APIs /// /// @@ -331,8 +331,8 @@ impl<'n, 'l, 'h, 'g, 'p, 'r> Arg<'n, 'l, 'h, 'g, 'p, 'r> { /// /// /// By default `clap` automatically assigns `v` and `h` to display version and help information - /// respectivly. You may use `v` or `h` for your own purposes, in which case `clap` simply - /// will not asign those to the displaying of version or help. + /// respectively. You may use `v` or `h` for your own purposes, in which case `clap` simply + /// will not assign those to the displaying of version or help. /// /// **NOTE:** Any leading `-` characters will be stripped, and only the first /// non `-` chacter will be used as the `short` version @@ -355,8 +355,8 @@ impl<'n, 'l, 'h, 'g, 'p, 'r> Arg<'n, 'l, 'h, 'g, 'p, 'r> { /// Sets the long version of the argument without the preceding `--`. /// /// By default `clap` automatically assigns `version` and `help` to display version and help - /// information respectivly. You may use `version` or `help` for your own purposes, in which - /// case `clap` simply will not asign those to the displaying of version or help automatically, + /// information respectively. You may use `version` or `help` for your own purposes, in which + /// case `clap` simply will not assign those to the displaying of version or help automatically, /// and you will have to do so manually. /// /// **NOTE:** Any leading `-` characters will be stripped @@ -620,7 +620,7 @@ impl<'n, 'l, 'h, 'g, 'p, 'r> Arg<'n, 'l, 'h, 'g, 'p, 'r> { /// Specifies if the flag may appear more than once such as for multiple debugging /// levels (as an example). `-ddd` for three levels of debugging, or `-d -d -d`. - /// When this is set to `true` you recieve the number of occurances the user supplied + /// When this is set to `true` you receive the number of occurrences the user supplied /// of a particular flag at runtime. /// /// **NOTE:** When setting this, any `takes_value` or `index` values you set @@ -709,7 +709,7 @@ impl<'n, 'l, 'h, 'g, 'p, 'r> Arg<'n, 'l, 'h, 'g, 'p, 'r> { pub fn number_of_values(mut self, qty: u8) -> Arg<'n, 'l, 'h, 'g, 'p, 'r> { if qty < 2 { panic!("Arguments with number_of_values(qty) qty must be > 1. Prefer \ - takes_value(true) for arguments with onyl one value, or flags for arguments \ + takes_value(true) for arguments with only one value, or flags for arguments \ with 0 values."); } self.num_vals = Some(qty); @@ -737,7 +737,7 @@ impl<'n, 'l, 'h, 'g, 'p, 'r> Arg<'n, 'l, 'h, 'g, 'p, 'r> { pub fn max_values(mut self, qty: u8) -> Arg<'n, 'l, 'h, 'g, 'p, 'r> { if qty < 2 { panic!("Arguments with max_values(qty) qty must be > 1. Prefer \ - takes_value(true) for arguments with onyl one value, or flags for arguments \ + takes_value(true) for arguments with only one value, or flags for arguments \ with 0 values."); } self.max_vals = Some(qty); @@ -755,7 +755,7 @@ impl<'n, 'l, 'h, 'g, 'p, 'r> Arg<'n, 'l, 'h, 'g, 'p, 'r> { /// **NOTE:** `qty` must be > 0 /// /// **NOTE:** `qty` *must* be > 0. If you wish to have an argument with 0 or more values prefer - /// two seperate arguments (a flag, and an option with multiple values). + /// two separate arguments (a flag, and an option with multiple values). /// /// # Example /// diff --git a/src/lib.rs b/src/lib.rs index f377736ceee..db2bcfa1241 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,8 +38,8 @@ //! - Optionally supports named values so that the usage/help info appears as `-o ` etc. for when you require specific multiple values //! - Optionally sets value parameters (such as the minimum number of values, the maximum number of values, or the exact number of values) //! * **Sub-Commands** (i.e. `git add ` where `add` is a sub-command of `git`) -//! - Support their own sub-arguments, and sub-sub-commands independant of the parent -//! - Get their own auto-generated Help, Version, and Usage independant of parent +//! - Support their own sub-arguments, and sub-sub-commands independent of the parent +//! - Get their own auto-generated Help, Version, and Usage independent of parent //! * **Requirement Rules**: Arguments can optionally define the following types of requirement rules //! - Required by default //! - Required only if certain arguments are present