diff --git a/src/args/flagarg.rs b/src/args/flagarg.rs index 03fd4484..b033a6dd 100644 --- a/src/args/flagarg.rs +++ b/src/args/flagarg.rs @@ -1,10 +1,35 @@ +/// `FlagArg` represents a flag argument for command line applications. Flag arguments +/// take no additional values, and are always preceded by either a `-` (single character) +/// or `--` (single word, no spaces). +/// Example: +/// ```sh +/// $ myprog -a --some +/// ``` pub struct FlagArg { + /// The unique name of the argument, required pub name: &'static str, + /// The short version (i.e. single character) + /// of the argument, no preceding `-` pub short: Option, + /// The long version of the flag (i.e. word) + /// without the preceding `--` pub long: Option<&'static str>, + /// The string of text that will displayed to + /// the user when the application's `help` + /// text is displayed pub help: Option<&'static str>, + /// Determines if multiple instances of the same + /// flag are allowed + /// I.e. `-v -v -v` or `-vvv` pub multiple: bool, + /// How many occurences of this flag have been + /// found when parsing pub occurrences: u8, + /// A list of names for other arguments that + /// *may not* be used with this flag pub blacklist: Option>, + /// A list of names of other arguments that + /// are *required* to be used when this + /// flag is used pub requires: Option> } \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 9d8bf770..6fc75911 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ #![feature(collections, core, libc, env)] //! A simply library for parsing command line arguments when writing -//! command line applications. +//! command line and console applications. pub use argmatches::ArgMatches; pub use arg::Arg; @@ -14,7 +14,3 @@ mod app; mod argmatches; mod arg; mod args; - -#[test] -fn it_works() { -}