@@ -98,27 +98,34 @@ use std::vec;
98
98
99
99
/// Name of an option. Either a string or a single char.
100
100
#[ deriving( Clone , Eq ) ]
101
- #[ allow( missing_doc) ]
102
101
pub enum Name {
102
+ /// A string representing the long name of an option.
103
+ /// For example: "help"
103
104
Long ( ~str ) ,
105
+ /// A char representing the short name of an option.
106
+ /// For example: 'h'
104
107
Short ( char ) ,
105
108
}
106
109
107
110
/// Describes whether an option has an argument.
108
111
#[ deriving( Clone , Eq ) ]
109
- #[ allow( missing_doc) ]
110
112
pub enum HasArg {
113
+ /// The option requires an argument.
111
114
Yes ,
115
+ /// The option is just a flag, therefore no argument.
112
116
No ,
117
+ /// The option argument is optional and it could or not exist.
113
118
Maybe ,
114
119
}
115
120
116
121
/// Describes how often an option may occur.
117
122
#[ deriving( Clone , Eq ) ]
118
- #[ allow( missing_doc) ]
119
123
pub enum Occur {
124
+ /// The option occurs once.
120
125
Req ,
126
+ /// The option could or not occur.
121
127
Optional ,
128
+ /// The option occurs once or multiple times.
122
129
Multi ,
123
130
}
124
131
@@ -176,12 +183,16 @@ pub struct Matches {
176
183
/// expected format. Call the `to_err_msg` method to retrieve the
177
184
/// error as a string.
178
185
#[ deriving( Clone , Eq , Show ) ]
179
- #[ allow( missing_doc) ]
180
186
pub enum Fail_ {
187
+ /// The option requires an argument but none was passed.
181
188
ArgumentMissing ( ~str ) ,
189
+ /// The passed option is not declared among the possible options.
182
190
UnrecognizedOption ( ~str ) ,
191
+ /// A required option is not present.
183
192
OptionMissing ( ~str ) ,
193
+ /// A single occurence option is being used multiple times.
184
194
OptionDuplicated ( ~str ) ,
195
+ /// There's an argument being passed to a non-argument option.
185
196
UnexpectedArgument ( ~str ) ,
186
197
}
187
198
0 commit comments