docs: fixed ClapErrorType docs

This commit is contained in:
Alexander Kuvaev 2015-09-06 01:12:46 +03:00
parent f3b99fc4e7
commit dd05784327

View file

@ -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
///
@ -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
///
@ -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
///
@ -60,6 +63,7 @@ pub enum ClapErrorType {
/// # .arg(
/// # Arg::with_name("color")
/// # ).get_matches_from_safe(vec!["", "--debug", "--color"]);
/// ```
EmptyValue,
/// Parser inner error
OptionError,
@ -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
///
@ -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
///
@ -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
///
@ -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
///
@ -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
///
@ -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.
///
@ -157,6 +167,7 @@ pub enum ClapErrorType {
/// # Arg::with_name("debug")
/// .multiple(false)
/// # ).get_matches_from_safe(vec!["", "--debug", "--debug"]);
/// ```
UnexpectedMultipleUsage
}