Skip to content

Commit

Permalink
getopts missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-andrade committed Mar 16, 2014
1 parent 7156ded commit 6b2888a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/libgetopts/lib.rs
Expand Up @@ -98,27 +98,34 @@ use std::vec;

/// Name of an option. Either a string or a single char.
#[deriving(Clone, Eq)]
#[allow(missing_doc)]
pub enum Name {
/// A string representing the long name of an option.
/// For example: "help"
Long(~str),
/// A char representing the short name of an option.
/// For example: 'h'
Short(char),
}

/// Describes whether an option has an argument.
#[deriving(Clone, Eq)]
#[allow(missing_doc)]
pub enum HasArg {
/// The option requires an argument.
Yes,
/// The option is just a flag, therefore no argument.
No,
/// The option argument is optional and it could or not exist.
Maybe,
}

/// Describes how often an option may occur.
#[deriving(Clone, Eq)]
#[allow(missing_doc)]
pub enum Occur {
/// The option occurs once.
Req,
/// The option could or not occur.
Optional,
/// The option occurs once or multiple times.
Multi,
}

Expand Down Expand Up @@ -176,12 +183,16 @@ pub struct Matches {
/// expected format. Call the `to_err_msg` method to retrieve the
/// error as a string.
#[deriving(Clone, Eq, Show)]
#[allow(missing_doc)]
pub enum Fail_ {
/// The option requires an argument but none was passed.
ArgumentMissing(~str),
/// The passed option is not declared among the possible options.
UnrecognizedOption(~str),
/// A required option is not present.
OptionMissing(~str),
/// A single occurence option is being used multiple times.
OptionDuplicated(~str),
/// There's an argument being passed to a non-argument option.
UnexpectedArgument(~str),
}

Expand Down

5 comments on commit 6b2888a

@bors
Copy link
Contributor

@bors bors commented on 6b2888a Mar 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at alan-andrade@6b2888a

@bors
Copy link
Contributor

@bors bors commented on 6b2888a Mar 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging alan-andrade/rust/docathon-getopts = 6b2888a into auto

@bors
Copy link
Contributor

@bors bors commented on 6b2888a Mar 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alan-andrade/rust/docathon-getopts = 6b2888a merged ok, testing candidate = 6fa72df

@bors
Copy link
Contributor

@bors bors commented on 6b2888a Mar 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 6fa72df

Please sign in to comment.