Skip to content

Commit

Permalink
docs(clap): fix typos caught by codespell
Browse files Browse the repository at this point in the history
Thanks to [tshepang](https://github.com/tshepang) for catching these!
  • Loading branch information
tshepang authored and kbknapp committed May 6, 2015
1 parent 0535cfb commit 8891d92
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <name> <other_name>` 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 <file>` 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
Expand Down
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))



Expand Down
2 changes: 1 addition & 1 deletion examples/01a_QuickExample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/01b_QuickExample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/03_Args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/06_PositionalArgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion examples/07_OptionArgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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...

Expand Down
6 changes: 3 additions & 3 deletions examples/08_SubCommands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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());
}

Expand Down
2 changes: 1 addition & 1 deletion examples/12_TypedValues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T,String> or Result<Vec<T>,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
Expand Down
4 changes: 2 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down
18 changes: 9 additions & 9 deletions src/args/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
///
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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
///
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
//! - Optionally supports named values so that the usage/help info appears as `-o <name> <other_name>` 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 <file>` 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
Expand Down

0 comments on commit 8891d92

Please sign in to comment.