Skip to content

Commit 43b3d40

Browse files
committed
docs: fix typos
1 parent 16c693a commit 43b3d40

File tree

7 files changed

+58
-58
lines changed

7 files changed

+58
-58
lines changed

src/app/mod.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<'a, 'b> App<'a, 'b> {
9090
/// In order to use this function you must compile `clap` with the `features = ["yaml"]` in
9191
/// your settings for the `[dependencies.clap]` table of your `Cargo.toml`
9292
///
93-
/// **NOTE:** Due to how the YAML objects are built there is a convienience macro for loading
93+
/// **NOTE:** Due to how the YAML objects are built there is a convenience macro for loading
9494
/// the YAML file at compile time (relative to the current file, like modules work). That YAML
9595
/// object can then be passed to this function.
9696
///
@@ -102,7 +102,7 @@ impl<'a, 'b> App<'a, 'b> {
102102
///
103103
/// # Examples
104104
///
105-
/// The following example shows how to load a properly formatted YAML file to build an instnace
105+
/// The following example shows how to load a properly formatted YAML file to build an instance
106106
/// of an [`App`] struct.
107107
///
108108
/// ```ignore
@@ -125,7 +125,7 @@ impl<'a, 'b> App<'a, 'b> {
125125
/// request the help information with `--help` or `-h`.
126126
///
127127
/// **Pro-tip:** If you turn on unstable features you can use `clap`s
128-
/// convienience macro [`crate_authors!`] to automatically set your
128+
/// convenience macro [`crate_authors!`] to automatically set your
129129
/// application's author to the same thing as your crate at compile time.
130130
/// See the [`examples/`]
131131
/// directory for more information
@@ -221,7 +221,7 @@ impl<'a, 'b> App<'a, 'b> {
221221
/// Sets a string of the version number to be displayed when displaying version or help
222222
/// information.
223223
///
224-
/// **Pro-tip:** Use `clap`s convienience macro [`crate_version!`] to automatically set your
224+
/// **Pro-tip:** Use `clap`s convenience macro [`crate_version!`] to automatically set your
225225
/// application's version to the same thing as your crate at compile time. See the [`examples/`]
226226
/// directory for more information
227227
///
@@ -318,7 +318,7 @@ impl<'a, 'b> App<'a, 'b> {
318318
/// your own.
319319
///
320320
/// **NOTE:** Any leading `-` characters will be stripped, and only the first
321-
/// non `-` chacter will be used as the [`short`] version
321+
/// non `-` character will be used as the [`short`] version
322322
///
323323
/// # Examples
324324
///
@@ -344,7 +344,7 @@ impl<'a, 'b> App<'a, 'b> {
344344
/// your own.
345345
///
346346
/// **NOTE:** Any leading `-` characters will be stripped, and only the first
347-
/// non `-` chacter will be used as the `short` version
347+
/// non `-` character will be used as the `short` version
348348
///
349349
/// # Examples
350350
///
@@ -558,7 +558,7 @@ impl<'a, 'b> App<'a, 'b> {
558558
self
559559
}
560560

561-
/// A convienience method for adding a single [argument] from a usage type string. The string
561+
/// A convenience method for adding a single [argument] from a usage type string. The string
562562
/// used follows the same rules and syntax as [`Arg::from_usage`]
563563
///
564564
/// **NOTE:** The downside to using this method is that you can not set any additional
@@ -615,8 +615,8 @@ impl<'a, 'b> App<'a, 'b> {
615615

616616
/// Allows adding a [`SubCommand`] alias, which function as "hidden" subcommands that
617617
/// automatically dispatch as if this subcommand was used. This is more efficient, and easier
618-
/// than creating multiple hidden subcommands as one only needs to check for the existing of
619-
/// this command, and not all vairants.
618+
/// than creating multiple hidden subcommands as one only needs to check for the existence of
619+
/// this command, and not all variants.
620620
///
621621
/// # Examples
622622
///
@@ -640,8 +640,8 @@ impl<'a, 'b> App<'a, 'b> {
640640

641641
/// Allows adding [`SubCommand`] aliases, which function as "hidden" subcommands that
642642
/// automatically dispatch as if this subcommand was used. This is more efficient, and easier
643-
/// than creating multiple hidden subcommands as one only needs to check for the existing of
644-
/// this command, and not all vairants.
643+
/// than creating multiple hidden subcommands as one only needs to check for the existence of
644+
/// this command, and not all variants.
645645
///
646646
/// # Examples
647647
///
@@ -940,7 +940,7 @@ impl<'a, 'b> App<'a, 'b> {
940940
}
941941

942942
/// Starts the parsing process, upon a failed parse an error will be displayed to the user and
943-
/// the process with exit with the appropriate error code. By default this method gets all user
943+
/// the process will exit with the appropriate error code. By default this method gets all user
944944
/// provided arguments from [`env::args_os`] in order to allow for invalid UTF-8 code points,
945945
/// which are legal on many platforms.
946946
///
@@ -958,7 +958,7 @@ impl<'a, 'b> App<'a, 'b> {
958958
}
959959

960960
/// Starts the parsing process. This method will return a [`clap::Result`] type instead of exiting
961-
/// the the process on failed parse. By default this method gets matches from [`env::args_os`]
961+
/// the process on failed parse. By default this method gets matches from [`env::args_os`]
962962
///
963963
/// **NOTE:** This method WILL NOT exit when `--help` or `--version` (or short versions) are
964964
/// used. It will return a [`clap::Error`], where the [`kind`] is a

src/app/settings.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ pub enum AppSettings {
232232
/// // running `myprog --help` will display a unified "docopt" or "getopts" style help message
233233
/// ```
234234
UnifiedHelpMessage,
235-
/// Will display a message "Press [ENTER]/[RETURN] to continue..." and wait user before
235+
/// Will display a message "Press [ENTER]/[RETURN] to continue..." and wait for user before
236236
/// exiting
237237
///
238238
/// This is most useful when writing an application which is run from a GUI shortcut, or on
@@ -332,9 +332,9 @@ pub enum AppSettings {
332332
/// the [`ArgMatches`] struct.
333333
///
334334
/// **NOTE:** Use this setting with caution, as a truly unexpected argument (i.e. one that is
335-
/// *NOT* an external subcommand) will **not** cause an error and instead be treatd as a
335+
/// *NOT* an external subcommand) will **not** cause an error and instead be treated as a
336336
/// potential subcommand. One should check for such cases manually and inform the user
337-
/// appropriatly.
337+
/// appropriately.
338338
///
339339
/// # Examples
340340
///

src/args/arg.rs

+37-37
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ impl<'a, 'b> Arg<'a, 'b> {
259259
///
260260
/// ### Explicit Name
261261
///
262-
/// This is an optional field, if it's omitted the argumenet will use one of the additioinal
262+
/// This is an optional field, if it's omitted the argument will use one of the additional
263263
/// fields as the name using the following priority order:
264264
///
265265
/// * Explicit Name (This always takes precedence when present)
@@ -424,7 +424,7 @@ impl<'a, 'b> Arg<'a, 'b> {
424424
///
425425
/// # Examples
426426
///
427-
/// To set `long` use a word containing valid UTF-8 codepoints. If you supply a dobule leading
427+
/// To set `long` use a word containing valid UTF-8 codepoints. If you supply a double leading
428428
/// `--` such as `--config` they will be stripped. Hyphens in the middle of the word, however,
429429
/// will *not* be stripped (i.e. `config-file` is allowed)
430430
///
@@ -628,9 +628,9 @@ impl<'a, 'b> Arg<'a, 'b> {
628628
}
629629

630630
/// Sets args that override this arg's required setting. (i.e. this arg will be required unless
631-
/// all these other argument are present).
631+
/// all these other arguments are present).
632632
///
633-
/// **NOTE:** If you wish for the this argument to only be required if *one of* these args are
633+
/// **NOTE:** If you wish for this argument to only be required if *one of* these args are
634634
/// present see [`Arg::required_unless_one`]
635635
///
636636
/// # Examples
@@ -703,9 +703,9 @@ impl<'a, 'b> Arg<'a, 'b> {
703703
}
704704

705705
/// Sets args that override this arg's [required] setting. (i.e. this arg will be required
706-
/// unless *at least one of* these other argument are present).
706+
/// unless *at least one of* these other arguments are present).
707707
///
708-
/// **NOTE:** If you wish for the this argument to only be required if *all of* these args are
708+
/// **NOTE:** If you wish for this argument to only be required if *all of* these args are
709709
/// present see [`Arg::required_unless_all`]
710710
///
711711
/// # Examples
@@ -879,7 +879,7 @@ impl<'a, 'b> Arg<'a, 'b> {
879879
/// will override each other in POSIX style (whichever argument was specified at runtime
880880
/// **last** "wins")
881881
///
882-
/// **NOTE:** When an argument is overriden it is essentially as if it never was used, any
882+
/// **NOTE:** When an argument is overridden it is essentially as if it never was used, any
883883
/// conflicts, requirements, etc. are evaluated **after** all "overrides" have been removed
884884
///
885885
/// # Examples
@@ -893,11 +893,11 @@ impl<'a, 'b> Arg<'a, 'b> {
893893
/// .arg(Arg::from_usage("-c, --color 'third flag'")
894894
/// .overrides_with("flag"))
895895
/// .get_matches_from(vec!["posix", "-f", "-d", "-c"]);
896-
/// // ^~~~~~~~~~~~^~~~~ flag is overriden by color
896+
/// // ^~~~~~~~~~~~^~~~~ flag is overridden by color
897897
///
898898
/// assert!(m.is_present("color"));
899899
/// assert!(m.is_present("debug")); // even though flag conflicts with debug, it's as if flag
900-
/// // was never used because it was overriden with color
900+
/// // was never used because it was overridden with color
901901
/// assert!(!m.is_present("flag"));
902902
/// ```
903903
pub fn overrides_with(mut self, name: &'a str) -> Self {
@@ -913,7 +913,7 @@ impl<'a, 'b> Arg<'a, 'b> {
913913
/// argument will override each other in POSIX style (whichever argument was specified at
914914
/// runtime **last** "wins")
915915
///
916-
/// **NOTE:** When an argument is overriden it is essentially as if it never was used, any
916+
/// **NOTE:** When an argument is overridden it is essentially as if it never was used, any
917917
/// conflicts, requirements, etc. are evaluated **after** all "overrides" have been removed
918918
///
919919
/// # Examples
@@ -927,10 +927,10 @@ impl<'a, 'b> Arg<'a, 'b> {
927927
/// .arg(Arg::from_usage("-c, --color 'third flag'")
928928
/// .overrides_with_all(&["flag", "debug"]))
929929
/// .get_matches_from(vec!["posix", "-f", "-d", "-c"]);
930-
/// // ^~~~~~^~~~~~~~~ flag and debug are overriden by color
930+
/// // ^~~~~~^~~~~~~~~ flag and debug are overridden by color
931931
///
932932
/// assert!(m.is_present("color")); // even though flag conflicts with color, it's as if flag
933-
/// // and debug were never used because they were overriden
933+
/// // and debug were never used because they were overridden
934934
/// // with color
935935
/// assert!(!m.is_present("debug"));
936936
/// assert!(!m.is_present("flag"));
@@ -961,7 +961,7 @@ impl<'a, 'b> Arg<'a, 'b> {
961961
/// ```
962962
///
963963
/// Setting [`Arg::requires(name)`] requires that the argument be used at runtime if the
964-
/// defining argument is used. If the defining argument isn't used, the other arguemnt isn't
964+
/// defining argument is used. If the defining argument isn't used, the other argument isn't
965965
/// required
966966
///
967967
/// ```rust
@@ -1027,7 +1027,7 @@ impl<'a, 'b> Arg<'a, 'b> {
10271027
///
10281028
/// Setting [`Arg::requires_all(&[arg, arg2])`] requires that all the arguments be used at
10291029
/// runtime if the defining argument is used. If the defining argument isn't used, the other
1030-
/// arguemnt isn't required
1030+
/// argument isn't required
10311031
///
10321032
/// ```rust
10331033
/// # use clap::{App, Arg};
@@ -1091,10 +1091,10 @@ impl<'a, 'b> Arg<'a, 'b> {
10911091
/// * Using an equals and no space such as `-o=value` or `--option=value`
10921092
/// * Use a short and no space such as `-ovalue`
10931093
///
1094-
/// **NOTE:** By default, args which allow [multiple values] are delimted by commas, meaning
1095-
/// `--option=val1,val2,val3` is is three values for the `--option` argument. If you wish to
1094+
/// **NOTE:** By default, args which allow [multiple values] are delimited by commas, meaning
1095+
/// `--option=val1,val2,val3` is three values for the `--option` argument. If you wish to
10961096
/// change the delimiter to another character you can use [`Arg::value_delimiter(char)`],
1097-
/// alternatively you can delimiting values **OFF** by using [`Arg::use_delimiter(false)`]
1097+
/// alternatively you can turn delimiting values **OFF** by using [`Arg::use_delimiter(false)`]
10981098
///
10991099
/// # Examples
11001100
///
@@ -1136,7 +1136,7 @@ impl<'a, 'b> Arg<'a, 'b> {
11361136
/// leave off the `index` method, and the index will be assigned in order of evaluation.
11371137
/// Utilizing the `index` method allows for setting indexes out of order
11381138
///
1139-
/// **NOTE:** When utilized with [`Arg::multiple(true)`], only the **last** psoitional argument
1139+
/// **NOTE:** When utilized with [`Arg::multiple(true)`], only the **last** positional argument
11401140
/// may be defined as multiple (i.e. with the highest index)
11411141
///
11421142
/// # Panics
@@ -1188,9 +1188,9 @@ impl<'a, 'b> Arg<'a, 'b> {
11881188
/// **WARNING:**
11891189
///
11901190
/// Setting `multiple(true)` for an [option] with no other details, allows multiple values
1191-
/// **and** multiple occurrences because it isn't possible to more occurrences than values for
1191+
/// **and** multiple occurrences because it isn't possible to have more occurrences than values for
11921192
/// options. Because multiple values are allowed, `--option val1 val2 val3` is perfectly valid,
1193-
/// be careful when designing a CLI where positional arguments are expectd after a option which
1193+
/// be careful when designing a CLI where positional arguments are expected after a option which
11941194
/// accepts multiple values, as `clap` will continue parsing *values* until it reaches the max
11951195
/// or specific number of values defined, or another flag or option.
11961196
///
@@ -1700,11 +1700,11 @@ impl<'a, 'b> Arg<'a, 'b> {
17001700
/// `-f <file>` argument where you wanted up to 3 'files' you would set `.max_values(3)`, and
17011701
/// this argument would be satisfied if the user provided, 1, 2, or 3 values.
17021702
///
1703-
/// **NOTE:** This does *not* implicitly set [`Arg::mulitple(true)`]. This is because
1704-
/// `-o val -o val` is multiples occurrences but a single value and `-o val1 val2` is a single
1703+
/// **NOTE:** This does *not* implicitly set [`Arg::multiple(true)`]. This is because
1704+
/// `-o val -o val` is multiple occurrences but a single value and `-o val1 val2` is a single
17051705
/// occurence with multple values. For positional arguments this **does** set
1706-
/// [`Arg::multiple(true)`] because there is no way to determine the diffrence between multiple
1707-
/// occureces and multiple values.
1706+
/// [`Arg::multiple(true)`] because there is no way to determine the difference between multiple
1707+
/// occurences and multiple values.
17081708
///
17091709
/// # Examples
17101710
///
@@ -1747,22 +1747,22 @@ impl<'a, 'b> Arg<'a, 'b> {
17471747
/// assert!(res.is_err());
17481748
/// assert_eq!(res.unwrap_err().kind, ErrorKind::TooManyValues);
17491749
/// ```
1750-
/// [`Arg::mulitple(true)`]: ./struct.Arg.html#method.multiple
1750+
/// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple
17511751
pub fn max_values(mut self, qty: u64) -> Self {
17521752
self.max_vals = Some(qty);
17531753
self
17541754
}
17551755

1756-
/// Specifies the *minimum* number of values are for this argument. For example, if you had a
1756+
/// Specifies the *minimum* number of values for this argument. For example, if you had a
17571757
/// `-f <file>` argument where you wanted at least 2 'files' you would set
17581758
/// `.min_values(2)`, and this argument would be satisfied if the user provided, 2 or more
17591759
/// values.
17601760
///
1761-
/// **NOTE:** This does not implicitly set [`Arg::mulitple(true)`]. This is because
1762-
/// `-o val -o val` is multiples occurrences but a single value and `-o val1 val2` is a single
1763-
/// occurence with multple values. For positional arguments this **does** set
1764-
/// [`Arg::multiple(true)`] because there is no way to determine the diffrence between multiple
1765-
/// occureces and multiple values.
1761+
/// **NOTE:** This does not implicitly set [`Arg::multiple(true)`]. This is because
1762+
/// `-o val -o val` is multiple occurrences but a single value and `-o val1 val2` is a single
1763+
/// occurence with multiple values. For positional arguments this **does** set
1764+
/// [`Arg::multiple(true)`] because there is no way to determine the difference between multiple
1765+
/// occurences and multiple values.
17661766
///
17671767
/// # Examples
17681768
///
@@ -1791,7 +1791,7 @@ impl<'a, 'b> Arg<'a, 'b> {
17911791
/// assert_eq!(files, ["file1", "file2", "file3"]);
17921792
/// ```
17931793
///
1794-
/// Supplying less than the mainimum number of values is an error
1794+
/// Supplying less than the minimum number of values is an error
17951795
///
17961796
/// ```rust
17971797
/// # use clap::{App, Arg, ErrorKind};
@@ -1805,18 +1805,18 @@ impl<'a, 'b> Arg<'a, 'b> {
18051805
/// assert!(res.is_err());
18061806
/// assert_eq!(res.unwrap_err().kind, ErrorKind::TooFewValues);
18071807
/// ```
1808-
/// [`Arg::mulitple(true)`]: ./struct.Arg.html#method.multiple
1808+
/// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple
18091809
pub fn min_values(mut self, qty: u64) -> Self {
18101810
self.min_vals = Some(qty);
18111811
self.set(ArgSettings::TakesValue)
18121812
}
18131813

1814-
/// Specifies whether or not an arugment should allow grouping of multiple values via a
1815-
/// delimter. I.e. shoulde `--option=val1,val2,val3` be parsed as three values (`val1`, `val2`,
1814+
/// Specifies whether or not an argument should allow grouping of multiple values via a
1815+
/// delimiter. I.e. should `--option=val1,val2,val3` be parsed as three values (`val1`, `val2`,
18161816
/// and `val3`) or as a single value (`val1,val2,val3`). Defaults to using `,` (comma) as the
18171817
/// value delimiter for all arguments that accept values (options and positional arguments)
18181818
///
1819-
/// **NOTE:** The defalt is `true`. Setting the value to `true` will reset any previous use of
1819+
/// **NOTE:** The default is `true`. Setting the value to `true` will reset any previous use of
18201820
/// [`Arg::value_delimiter`] back to the default of `,` (comma).
18211821
///
18221822
/// # Examples
@@ -1978,7 +1978,7 @@ impl<'a, 'b> Arg<'a, 'b> {
19781978
}
19791979

19801980
/// Specifies the name for value of [option] or [positional] arguments inside of help
1981-
/// documenation. This name is cosmetic only, the name is **not** used to access arguments.
1981+
/// documentation. This name is cosmetic only, the name is **not** used to access arguments.
19821982
/// This setting can be very helpful when describing the type of input the user should be
19831983
/// using, such as `FILE`, `INTERFACE`, etc. Although not required, it's somewhat convention to
19841984
/// use all capital letters for the value name.

src/args/arg_matches.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ impl<'a> ArgMatches<'a> {
408408
/// An ASCII art depiction may help explain this better...Using a fictional version of `git` as
409409
/// the demo subject. Imagine the following are all subcommands of `git` (note, the author is
410410
/// aware these aren't actually all subcommands in the real `git` interface, but it makes
411-
/// explaination easier)
411+
/// explanation easier)
412412
///
413413
/// ```notrust
414414
/// Top Level App (git) TOP

src/args/group.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use yaml_rust::Yaml;
2828
/// specify that *at least one* of them is used. For this, you can create a group.
2929
///
3030
/// Finally, you may use `ArgGroup`s to pull a value from a group of arguments when you don't care
31-
/// exaclty which argument was actually used at runtime.
31+
/// exactly which argument was actually used at runtime.
3232
///
3333
/// # Examples
3434
///
@@ -204,7 +204,7 @@ impl<'a> ArgGroup<'a> {
204204
/// // maybe we don't know which of the two flags was used...
205205
/// assert!(m.is_present("req_flags"));
206206
/// ```
207-
/// In this next example, we show the default behavior (i.e. `multiple(false)) which is throw
207+
/// In this next example, we show the default behavior (i.e. `multiple(false)) which will throw
208208
/// an error if more than one of the args in the group was used.
209209
///
210210
/// ```rust

0 commit comments

Comments
 (0)