Skip to content

Commit 6fa72df

Browse files
committed
2 parents ffe72e9 + 6b2888a commit 6fa72df

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/libgetopts/lib.rs

+15-4
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,34 @@ use std::vec;
9898

9999
/// Name of an option. Either a string or a single char.
100100
#[deriving(Clone, Eq)]
101-
#[allow(missing_doc)]
102101
pub enum Name {
102+
/// A string representing the long name of an option.
103+
/// For example: "help"
103104
Long(~str),
105+
/// A char representing the short name of an option.
106+
/// For example: 'h'
104107
Short(char),
105108
}
106109

107110
/// Describes whether an option has an argument.
108111
#[deriving(Clone, Eq)]
109-
#[allow(missing_doc)]
110112
pub enum HasArg {
113+
/// The option requires an argument.
111114
Yes,
115+
/// The option is just a flag, therefore no argument.
112116
No,
117+
/// The option argument is optional and it could or not exist.
113118
Maybe,
114119
}
115120

116121
/// Describes how often an option may occur.
117122
#[deriving(Clone, Eq)]
118-
#[allow(missing_doc)]
119123
pub enum Occur {
124+
/// The option occurs once.
120125
Req,
126+
/// The option could or not occur.
121127
Optional,
128+
/// The option occurs once or multiple times.
122129
Multi,
123130
}
124131

@@ -176,12 +183,16 @@ pub struct Matches {
176183
/// expected format. Call the `to_err_msg` method to retrieve the
177184
/// error as a string.
178185
#[deriving(Clone, Eq, Show)]
179-
#[allow(missing_doc)]
180186
pub enum Fail_ {
187+
/// The option requires an argument but none was passed.
181188
ArgumentMissing(~str),
189+
/// The passed option is not declared among the possible options.
182190
UnrecognizedOption(~str),
191+
/// A required option is not present.
183192
OptionMissing(~str),
193+
/// A single occurence option is being used multiple times.
184194
OptionDuplicated(~str),
195+
/// There's an argument being passed to a non-argument option.
185196
UnexpectedArgument(~str),
186197
}
187198

0 commit comments

Comments
 (0)