about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-16 20:41:57 -0700
committerbors <bors@rust-lang.org>2014-03-16 20:41:57 -0700
commit6fa72dfe48c8db04562f4d3ab640cb90804af69b (patch)
tree02c65e74f67505d8b26424536218b288e38246b1 /src
parentffe72e95368aba02d002be0095522548e8f0ee79 (diff)
parent6b2888aeec08c56200ed26576eafb2d27ca079b8 (diff)
downloadrust-6fa72dfe48c8db04562f4d3ab640cb90804af69b.tar.gz
rust-6fa72dfe48c8db04562f4d3ab640cb90804af69b.zip
auto merge of #12942 : alan-andrade/rust/docathon-getopts, r=alexcrichton
https://docs.google.com/spreadsheet/ccc?key=0An9tLRVf1SSfdE9jX1Q2QkhiUGVwTnh5YTJnMHVUYXc&usp=sharing#gid=6


Diffstat (limited to 'src')
-rw-r--r--src/libgetopts/lib.rs19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs
index 6aa064bb69a..43b05e7e2e7 100644
--- a/src/libgetopts/lib.rs
+++ b/src/libgetopts/lib.rs
@@ -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,
 }
 
@@ -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),
 }