Skip to content

Commit

Permalink
extra / rustpkg: Make getopts::opt_val private again
Browse files Browse the repository at this point in the history
and use opt_str instead of opt_val in rustpkg

Closes #9311
  • Loading branch information
catamorphism committed Nov 9, 2013
1 parent a594a99 commit 06b2905
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/libextra/getopts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,14 @@ impl Name {
}

impl Matches {
/// FIXME: #9311 This used to be private, but rustpkg somehow managed to depend on it.
/// No idea what this does.
pub fn opt_vals(&self, nm: &str) -> ~[Optval] {
fn opt_vals(&self, nm: &str) -> ~[Optval] {
match find_opt(self.opts, Name::from_str(nm)) {
Some(id) => self.vals[id].clone(),
None => fail!("No option '{}' defined", nm)
}
}

/// FIXME: #9311 This used to be private, but rustpkg somehow managed to depend on it.
/// No idea what this does.
pub fn opt_val(&self, nm: &str) -> Option<Optval> {
fn opt_val(&self, nm: &str) -> Option<Optval> {
let vals = self.opt_vals(nm);
if (vals.is_empty()) {
None
Expand Down
4 changes: 2 additions & 2 deletions src/librustpkg/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ pub fn main_args(args: &[~str]) -> int {
matches.opt_present("help");
let no_link = matches.opt_present("no-link");
let no_trans = matches.opt_present("no-trans");
let supplied_sysroot = matches.opt_val("sysroot");
let supplied_sysroot = matches.opt_str("sysroot");
let generate_asm = matches.opt_present("S") ||
matches.opt_present("assembly");
let parse_only = matches.opt_present("parse-only");
Expand Down Expand Up @@ -894,7 +894,7 @@ pub fn main_args(args: &[~str]) -> int {
let mut remaining_args: ~[~str] = remaining_args.map(|s| (*s).clone()).collect();
remaining_args.shift();
let sroot = match supplied_sysroot {
Some(getopts::Val(s)) => Path::new(s),
Some(s) => Path::new(s),
_ => filesearch::get_or_default_sysroot()
};

Expand Down

9 comments on commit 06b2905

@bors
Copy link
Contributor

@bors bors commented on 06b2905 Nov 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from catamorphism
at catamorphism@06b2905

@bors
Copy link
Contributor

@bors bors commented on 06b2905 Nov 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging catamorphism/rust/rustpkg-issue-9311 = 06b2905 into auto

@bors
Copy link
Contributor

@bors bors commented on 06b2905 Nov 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catamorphism/rust/rustpkg-issue-9311 = 06b2905 merged ok, testing candidate = 8a5bc2a0

@bors
Copy link
Contributor

@bors bors commented on 06b2905 Nov 9, 2013

@bors
Copy link
Contributor

@bors bors commented on 06b2905 Nov 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from catamorphism
at catamorphism@06b2905

@bors
Copy link
Contributor

@bors bors commented on 06b2905 Nov 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging catamorphism/rust/rustpkg-issue-9311 = 06b2905 into auto

@bors
Copy link
Contributor

@bors bors commented on 06b2905 Nov 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catamorphism/rust/rustpkg-issue-9311 = 06b2905 merged ok, testing candidate = dc5d9b9

@bors
Copy link
Contributor

@bors bors commented on 06b2905 Nov 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 06b2905 Nov 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = dc5d9b9

Please sign in to comment.