Skip to content

Commit

Permalink
docs: fixed ClapErrorType docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinatorul committed Sep 5, 2015
1 parent f3b99fc commit dd05784
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/app/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub enum ClapErrorType {
/// .possible_value("fast")
/// .possible_value("slow")
/// # ).get_matches_from_safe(vec!["", "other"]);
/// ```
InvalidValue,
/// Error occurs when clap found unexpected flag or option
///
Expand All @@ -29,6 +30,7 @@ pub enum ClapErrorType {
/// # .arg(
/// # Arg::from_usage("-f, --flag 'some flag'")
/// # ).get_matches_from_safe(vec!["", "--other"]);
/// ```
InvalidArgument,
/// Error occurs when clap found unexpected subcommand
///
Expand All @@ -45,6 +47,7 @@ pub enum ClapErrorType {
/// .help("The configuration file to use")
/// .index(1))
/// # ).get_matches_from_safe(vec!["", "other"]);
/// ```
InvalidSubcommand,
/// Error occurs when option does not allow empty values but some was found
///
Expand All @@ -60,6 +63,7 @@ pub enum ClapErrorType {
/// # .arg(
/// # Arg::with_name("color")
/// # ).get_matches_from_safe(vec!["", "--debug", "--color"]);
/// ```
EmptyValue,
/// Parser inner error
OptionError,
Expand All @@ -79,6 +83,7 @@ pub enum ClapErrorType {
/// # Arg::with_name("debug").index(1)
/// .max_values(2)
/// # ).get_matches_from_safe(vec!["", "too", "much", "values"]);
/// ```
TooMuchValues,
/// Error occurs when argument got less values then were expected
///
Expand All @@ -92,6 +97,7 @@ pub enum ClapErrorType {
/// # Arg::with_name("debug").index(1)
/// .min_values(3)
/// # ).get_matches_from_safe(vec!["", "too", "few"]);
/// ```
TooFewValues,
/// Error occurs when clap find two ore more conflicting arguments
///
Expand All @@ -105,6 +111,7 @@ pub enum ClapErrorType {
/// # Arg::with_name("debug")
/// .conflicts_with("color")
/// # ).get_matches_from_safe(vec!["", "--debug", "--color"]);
/// ```
ArgumentConflict,
/// Error occurs when one or more required arguments missing
///
Expand All @@ -118,6 +125,7 @@ pub enum ClapErrorType {
/// # Arg::with_name("debug")
/// .required(true)
/// # ).get_matches_from_safe(vec![""]);
/// ```
MissingRequiredArgument,
/// Error occurs when required subcommand missing
///
Expand All @@ -135,6 +143,7 @@ pub enum ClapErrorType {
/// .help("The configuration file to use")
/// .index(1))
/// # ).get_matches_from_safe(vec![""]);
/// ```
MissingSubcommand,
/// Error occurs when clap find argument while is was not expecting any
///
Expand All @@ -144,6 +153,7 @@ pub enum ClapErrorType {
/// ```no_run
/// # use clap::{App};
/// # let result = App::new("myprog").get_matches_from_safe(vec!["", "--arg"]);
/// ```
UnexpectedArgument,
/// Error occurs when argument was used multiple times and was not set as multiple.
///
Expand All @@ -157,6 +167,7 @@ pub enum ClapErrorType {
/// # Arg::with_name("debug")
/// .multiple(false)
/// # ).get_matches_from_safe(vec!["", "--debug", "--debug"]);
/// ```
UnexpectedMultipleUsage
}

Expand Down

0 comments on commit dd05784

Please sign in to comment.