diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-03-27 15:10:18 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-03-31 15:17:13 -0700 |
| commit | 5f33588d75966b939df288cf2125e9906e15cf82 (patch) | |
| tree | 1ee8350a185f20397b000f4c949df0fefeab442a | |
| parent | 8ad7e5481f970ba8d1103b4cc20a71335aba466e (diff) | |
getopts: Switch field privacy as necessary
| -rw-r--r-- | src/libgetopts/lib.rs | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index e47e7ddec20..e8a40ed66a1 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -87,6 +87,8 @@ #![deny(missing_doc)] #![deny(deprecated_owned_vector)] +#![allow(visible_private_types)] // NOTE: remove after a stage0 snap + #[cfg(test)] #[phase(syntax, link)] extern crate log; use std::cmp::Eq; @@ -130,13 +132,13 @@ pub enum Occur { #[deriving(Clone, Eq)] pub struct Opt { /// Name of the option - name: Name, + pub name: Name, /// Whether it has an argument - hasarg: HasArg, + pub hasarg: HasArg, /// How often it can occur - occur: Occur, + pub occur: Occur, /// Which options it aliases - priv aliases: Vec<Opt> , + pub aliases: Vec<Opt> , } /// One group of options, e.g., both -h and --help, along with @@ -144,17 +146,17 @@ pub struct Opt { #[deriving(Clone, Eq)] pub struct OptGroup { /// Short Name of the `OptGroup` - short_name: ~str, + pub short_name: ~str, /// Long Name of the `OptGroup` - long_name: ~str, + pub long_name: ~str, /// Hint - hint: ~str, + pub hint: ~str, /// Description - desc: ~str, + pub desc: ~str, /// Whether it has an argument - hasarg: HasArg, + pub hasarg: HasArg, /// How often it can occur - occur: Occur + pub occur: Occur } /// Describes wether an option is given at all or has a value. @@ -169,11 +171,12 @@ enum Optval { #[deriving(Clone, Eq)] pub struct Matches { /// Options that matched - priv opts: Vec<Opt> , + opts: Vec<Opt> , /// Values of the Options that matched - priv vals: Vec<Vec<Optval> > , + vals: Vec<Vec<Optval> > , /// Free string fragments - free: Vec<~str> } + pub free: Vec<~str>, +} /// The type returned when the command line does not conform to the /// expected format. Call the `to_err_msg` method to retrieve the |
