diff --git a/CHANGELOG.md b/CHANGELOG.md index 2322dc54402..501271cd622 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -675,7 +675,7 @@ Minimum version of Rust is now v1.13.0 (Stable) #### Bug Fixes -* **Low Index Multiples:** fixes a bug where using low index multiples was propgated to subcommands ([33924e88](https://github.com/kbknapp/clap-rs/commit/33924e884461983c4e6b5ea1330fecc769a4ade7), closes [#725](https://github.com/kbknapp/clap-rs/issues/725)) +* **Low Index Multiples:** fixes a bug where using low index multiples was propagated to subcommands ([33924e88](https://github.com/kbknapp/clap-rs/commit/33924e884461983c4e6b5ea1330fecc769a4ade7), closes [#725](https://github.com/kbknapp/clap-rs/issues/725)) diff --git a/src/app/help.rs b/src/app/help.rs index 884fe450602..54cb85c82bb 100644 --- a/src/app/help.rs +++ b/src/app/help.rs @@ -841,7 +841,7 @@ fn copy_and_capture( // The end of the reader was found without finding the closing tag. // Write the opening byte and captured text to the writer. - // Return 0 indicating that nothing was caputred but the reader still contains data. + // Return 0 indicating that nothing was captured but the reader still contains data. DelimiterNotFound(not_tag_length) => match w.write(b"{") { Err(e) => Some(Err(e)), _ => match w.write(&tag_buffer.get_ref()[0..not_tag_length]) { @@ -884,7 +884,7 @@ impl<'a> Help<'a> { let mut tmplr = Cursor::new(&template); let mut tag_buf = Cursor::new(vec![0u8; 15]); - // The strategy is to copy the template from the the reader to wrapped stream + // The strategy is to copy the template from the reader to wrapped stream // until a tag is found. Depending on its value, the appropriate content is copied // to the wrapped stream. // The copy from template is then resumed, repeating this sequence until reading diff --git a/src/app/mod.rs b/src/app/mod.rs index 0a27cb36678..c4fd69db28b 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -785,7 +785,7 @@ impl<'a, 'b> App<'a, 'b> { self } - /// Adds multiple [arguments] to the list of valid possibilties + /// Adds multiple [arguments] to the list of valid possibilities /// /// # Examples /// @@ -976,7 +976,7 @@ impl<'a, 'b> App<'a, 'b> { /// Meaning any of the arguments that belong to that group will cause a failure if present with /// the conflicting argument. /// - /// Another added benfit of [`ArgGroup`]s is that you can extract a value from a group instead + /// Another added benefit of [`ArgGroup`]s is that you can extract a value from a group instead /// of determining exactly which argument was used. /// /// Finally, using [`ArgGroup`]s to ensure exclusion between arguments is another very common @@ -1156,7 +1156,7 @@ impl<'a, 'b> App<'a, 'b> { /// [`-h` (short)]: ./struct.Arg.html#method.help /// [`--help` (long)]: ./struct.Arg.html#method.long_help pub fn print_help(&mut self) -> ClapResult<()> { - // If there are global arguments, or settings we need to propgate them down to subcommands + // If there are global arguments, or settings we need to propagate them down to subcommands // before parsing incase we run into a subcommand self.p.propagate_globals(); self.p.propagate_settings(); @@ -1186,7 +1186,7 @@ impl<'a, 'b> App<'a, 'b> { /// [`-h` (short)]: ./struct.Arg.html#method.help /// [`--help` (long)]: ./struct.Arg.html#method.long_help pub fn print_long_help(&mut self) -> ClapResult<()> { - // If there are global arguments, or settings we need to propgate them down to subcommands + // If there are global arguments, or settings we need to propagate them down to subcommands // before parsing incase we run into a subcommand self.p.propagate_globals(); self.p.propagate_settings(); @@ -1206,7 +1206,7 @@ impl<'a, 'b> App<'a, 'b> { /// /// **NOTE:** There is a known bug where this method does not write propagated global arguments /// or autogenerated arguments (i.e. the default help/version args). Prefer - /// [`App::write_long_help`] instead if possibe! + /// [`App::write_long_help`] instead if possible! /// /// # Examples /// @@ -1223,7 +1223,7 @@ impl<'a, 'b> App<'a, 'b> { pub fn write_help(&self, w: &mut W) -> ClapResult<()> { // PENDING ISSUE: 808 // https://github.com/kbknapp/clap-rs/issues/808 - // If there are global arguments, or settings we need to propgate them down to subcommands + // If there are global arguments, or settings we need to propagate them down to subcommands // before parsing incase we run into a subcommand // self.p.propagate_globals(); // self.p.propagate_settings(); @@ -1596,7 +1596,7 @@ impl<'a, 'b> App<'a, 'b> { I: IntoIterator, T: Into + Clone, { - // If there are global arguments, or settings we need to propgate them down to subcommands + // If there are global arguments, or settings we need to propagate them down to subcommands // before parsing incase we run into a subcommand if !self.p.is_set(AppSettings::Propagated) { self.p.propagate_globals(); diff --git a/src/app/settings.rs b/src/app/settings.rs index 840d77585c5..aef2a5874a2 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -505,7 +505,7 @@ pub enum AppSettings { DeriveDisplayOrder, /// Specifies to use the version of the current command for all child [`SubCommand`]s. - /// (Defaults to `false`; subcommands have independant version strings from their parents.) + /// (Defaults to `false`; subcommands have independent version strings from their parents.) /// /// **NOTE:** The version for the current command **and** this setting must be set **prior** to /// adding any child subcommands @@ -553,7 +553,7 @@ pub enum AppSettings { /// designing CLIs which allow inferred subcommands and have potential positional/free /// arguments whose values could start with the same characters as subcommands. If this is the /// case, it's recommended to use settings such as [`AppSeettings::ArgsNegateSubcommands`] in - /// conjuction with this setting. + /// conjunction with this setting. /// /// # Examples /// diff --git a/src/args/arg.rs b/src/args/arg.rs index d2587697fae..4faba969b10 100644 --- a/src/args/arg.rs +++ b/src/args/arg.rs @@ -1979,7 +1979,7 @@ impl<'a, 'b> Arg<'a, 'b> { /// **WARNING:** /// /// When using args with `multiple(true)` on [options] or [positionals] (i.e. those args that - /// accept values) and [subcommands], one needs to consider the posibility of an argument value + /// accept values) and [subcommands], one needs to consider the possibility of an argument value /// being the same as a valid subcommand. By default `clap` will parse the argument in question /// as a value *only if* a value is possible at that moment. Otherwise it will be parsed as a /// subcommand. In effect, this means using `multiple(true)` with no additional parameters and @@ -2049,7 +2049,7 @@ impl<'a, 'b> Arg<'a, 'b> { /// let files: Vec<_> = m.values_of("file").unwrap().collect(); /// assert_eq!(files, ["file1", "file2", "file3"]); /// ``` - /// This is functionally equivilant to the example above + /// This is functionally equivalent to the example above /// /// ```rust /// # use clap::{App, Arg}; @@ -2220,7 +2220,7 @@ impl<'a, 'b> Arg<'a, 'b> { /// # ; /// ``` /// - /// 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. /// @@ -2727,9 +2727,9 @@ impl<'a, 'b> Arg<'a, 'b> { /// /// **NOTE:** This does *not* implicitly set [`Arg::multiple(true)`]. This is because /// `-o val -o val` is multiple occurrences but a single value and `-o val1 val2` is a single - /// occurence with multiple values. For positional arguments this **does** set + /// occurrence with multiple values. For positional arguments this **does** set /// [`Arg::multiple(true)`] because there is no way to determine the difference between multiple - /// occurences and multiple values. + /// occurrences and multiple values. /// /// # Examples /// @@ -2790,9 +2790,9 @@ impl<'a, 'b> Arg<'a, 'b> { /// /// **NOTE:** This does not implicitly set [`Arg::multiple(true)`]. This is because /// `-o val -o val` is multiple occurrences but a single value and `-o val1 val2` is a single - /// occurence with multiple values. For positional arguments this **does** set + /// occurrence with multiple values. For positional arguments this **does** set /// [`Arg::multiple(true)`] because there is no way to determine the difference between multiple - /// occurences and multiple values. + /// occurrences and multiple values. /// /// # Examples /// @@ -3187,7 +3187,7 @@ impl<'a, 'b> Arg<'a, 'b> { /// **NOTE:** This implicitly sets [`Arg::takes_value(true)`]. /// /// **NOTE:** This setting effectively disables `AppSettings::ArgRequiredElseHelp` if used in - /// conjuction as it ensures that some argument will always be present. + /// conjunction as it ensures that some argument will always be present. /// /// # Examples /// @@ -3429,7 +3429,7 @@ impl<'a, 'b> Arg<'a, 'b> { /// ``` /// /// We can also see that these values are applied in order, and if more than one condition is - /// true, only the first evaluatd "wins" + /// true, only the first evaluated "wins" /// /// ```rust /// # use clap::{App, Arg}; @@ -3484,7 +3484,7 @@ impl<'a, 'b> Arg<'a, 'b> { /// will return `0` even though the [`ArgMatches::value_of`] will return the default specified. /// /// **NOTE:** If the user *does not* use this argument at runtime [`ArgMatches::is_present`] will - /// return `true` if the variable is present in the environemnt . If you wish to determine whether + /// return `true` if the variable is present in the environment . If you wish to determine whether /// the argument was used at runtime or not, consider [`ArgMatches::occurrences_of`] which will /// return `0` if the argument was *not* used at runtime. /// diff --git a/src/args/settings.rs b/src/args/settings.rs index 9de94d69579..72f91d3f757 100644 --- a/src/args/settings.rs +++ b/src/args/settings.rs @@ -61,6 +61,7 @@ impl Default for ArgFlags { /// Various settings that apply to arguments and may be set, unset, and checked via getter/setter /// methods [`Arg::set`], [`Arg::unset`], and [`Arg::is_set`] +/// /// [`Arg::set`]: ./struct.Arg.html#method.set /// [`Arg::unset`]: ./struct.Arg.html#method.unset /// [`Arg::is_set`]: ./struct.Arg.html#method.is_set @@ -79,7 +80,7 @@ pub enum ArgSettings { Hidden, /// The argument accepts a value, such as `--option ` TakesValue, - /// Determines if the argument allows values to be grouped via a delimter + /// Determines if the argument allows values to be grouped via a delimiter UseValueDelimiter, /// Prints the help text on the line after the argument NextLineHelp, diff --git a/src/errors.rs b/src/errors.rs index 1c870341da8..84a00fd14e9 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -13,6 +13,7 @@ use fmt::{ColorWhen, Colorizer, ColorizerOption}; use suggestions; /// Short hand for [`Result`] type +/// /// [`Result`]: https://doc.rust-lang.org/std/result/enum.Result.html pub type Result = StdResult; @@ -77,7 +78,7 @@ pub enum ErrorKind { /// Occurs when the user provides an unrecognized [`SubCommand`] which either /// doesn't meet the threshold for being similar enough to an existing subcommand, - /// or the 'sggestions' feature is disabled. + /// or the 'suggestions' feature is disabled. /// Otherwise the more detailed [`InvalidSubcommand`] error is returned. /// /// This error typically happens when passing additional subcommand names to the `help` @@ -294,7 +295,7 @@ pub enum ErrorKind { /// Occurs when the user provides a value containing invalid UTF-8 for an argument and /// [`AppSettings::StrictUtf8`] is set. /// - /// # Platform Speicific + /// # Platform Specific /// /// Non-Windows platforms only (such as Linux, Unix, OSX, etc.) /// @@ -372,7 +373,7 @@ pub enum ErrorKind { /// Command Line Argument Parser Error #[derive(Debug)] pub struct Error { - /// Formated error message + /// Formatted error message pub message: String, /// The type of error pub kind: ErrorKind, diff --git a/src/macros.rs b/src/macros.rs index 52fb35a4de9..98a39e8e2f5 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -9,7 +9,7 @@ /// /// # Examples /// -/// The following example shows how to load a properly formatted YAML file to build an instnace +/// The following example shows how to load a properly formatted YAML file to build an instance /// of an `App` struct. /// /// ```ignore @@ -607,10 +607,10 @@ macro_rules! app_from_crate { /// * Three dots (`...`) sets [`Arg::multiple(true)`] /// * Angled brackets after either a short or long will set [`Arg::value_name`] and /// `Arg::required(true)` such as `--config ` = `Arg::value_name("FILE")` and -/// `Arg::required(true) +/// `Arg::required(true)` /// * Square brackets after either a short or long will set [`Arg::value_name`] and /// `Arg::required(false)` such as `--config [FILE]` = `Arg::value_name("FILE")` and -/// `Arg::required(false) +/// `Arg::required(false)` /// * There are short hand syntaxes for Arg methods that accept booleans /// * A plus sign will set that method to `true` such as `+required` = `Arg::required(true)` /// * An exclamation will set that method to `false` such as `!required` = `Arg::required(false)`