Skip to content

Commit 5f33588

Browse files
committed
getopts: Switch field privacy as necessary
1 parent 8ad7e54 commit 5f33588

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/libgetopts/lib.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
#![deny(missing_doc)]
8888
#![deny(deprecated_owned_vector)]
8989

90+
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
91+
9092
#[cfg(test)] #[phase(syntax, link)] extern crate log;
9193

9294
use std::cmp::Eq;
@@ -130,31 +132,31 @@ pub enum Occur {
130132
#[deriving(Clone, Eq)]
131133
pub struct Opt {
132134
/// Name of the option
133-
name: Name,
135+
pub name: Name,
134136
/// Whether it has an argument
135-
hasarg: HasArg,
137+
pub hasarg: HasArg,
136138
/// How often it can occur
137-
occur: Occur,
139+
pub occur: Occur,
138140
/// Which options it aliases
139-
priv aliases: Vec<Opt> ,
141+
pub aliases: Vec<Opt> ,
140142
}
141143

142144
/// One group of options, e.g., both -h and --help, along with
143145
/// their shared description and properties.
144146
#[deriving(Clone, Eq)]
145147
pub struct OptGroup {
146148
/// Short Name of the `OptGroup`
147-
short_name: ~str,
149+
pub short_name: ~str,
148150
/// Long Name of the `OptGroup`
149-
long_name: ~str,
151+
pub long_name: ~str,
150152
/// Hint
151-
hint: ~str,
153+
pub hint: ~str,
152154
/// Description
153-
desc: ~str,
155+
pub desc: ~str,
154156
/// Whether it has an argument
155-
hasarg: HasArg,
157+
pub hasarg: HasArg,
156158
/// How often it can occur
157-
occur: Occur
159+
pub occur: Occur
158160
}
159161

160162
/// Describes wether an option is given at all or has a value.
@@ -169,11 +171,12 @@ enum Optval {
169171
#[deriving(Clone, Eq)]
170172
pub struct Matches {
171173
/// Options that matched
172-
priv opts: Vec<Opt> ,
174+
opts: Vec<Opt> ,
173175
/// Values of the Options that matched
174-
priv vals: Vec<Vec<Optval> > ,
176+
vals: Vec<Vec<Optval> > ,
175177
/// Free string fragments
176-
free: Vec<~str> }
178+
pub free: Vec<~str>,
179+
}
177180

178181
/// The type returned when the command line does not conform to the
179182
/// expected format. Call the `to_err_msg` method to retrieve the

0 commit comments

Comments
 (0)