docs: Fix some typos and markdown issues.

This commit is contained in:
Kevin K 2018-03-19 16:53:19 -04:00
parent 919fd32dfb
commit 92eab59dfc
No known key found for this signature in database
GPG key ID: 17218E4B3692F01A
7 changed files with 23 additions and 22 deletions

View file

@ -632,7 +632,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))

View file

@ -949,7 +949,7 @@ fn copy_and_capture<R: Read, W: Write>(
// 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]) {
@ -991,7 +991,7 @@ impl<'w> Help<'w> {
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

View file

@ -693,7 +693,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
///
@ -829,7 +829,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
@ -1009,7 +1009,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._build(Propagation::NextLevel);
@ -1036,7 +1036,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._build(Propagation::NextLevel);

View file

@ -503,7 +503,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
@ -551,7 +551,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
///

View file

@ -1879,9 +1879,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
///
@ -1943,9 +1943,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
///
@ -2194,7 +2194,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
///
@ -2436,7 +2436,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};
@ -2491,7 +2491,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.
///

View file

@ -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<T> = StdResult<T, Error>;
@ -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,

View file

@ -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 <FILE>` = `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)`