]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #7840 : alexcrichton/rust/better-test-help, r=huonw
authorbors <bors@rust-lang.org>
Thu, 18 Jul 2013 13:52:41 +0000 (06:52 -0700)
committerbors <bors@rust-lang.org>
Thu, 18 Jul 2013 13:52:41 +0000 (06:52 -0700)
Progress on #7824, closes #7825

1  2 
src/libextra/test.rs

index c552ef2b8b6c2f2dc93d204e3dfa6d88f08f0d0b,783b96f8962d38b2eb4da7e029bd7807daed40e8..910c95eb8f9ae7a237d58be5214cc362a8e1734b
@@@ -27,8 -28,8 +28,9 @@@ use term
  use time::precise_time_ns;
  use treemap::TreeMap;
  
 +use std::clone::Clone;
  use std::comm::{stream, SharedChan};
+ use std::libc;
  use std::either;
  use std::io;
  use std::result;
@@@ -185,12 -213,13 +226,15 @@@ pub fn parse_opts(args: &[~str]) -> Opt
            Err(f) => return either::Right(getopts::fail_str(f))
          };
  
+     if getopts::opt_present(&matches, "h") { usage(args[0], "h"); }
+     if getopts::opt_present(&matches, "help") { usage(args[0], "help"); }
      let filter =
          if matches.free.len() > 0 {
 -            Some(copy (matches).free[0])
 -        } else { None };
 +            Some((matches).free[0].clone())
 +        } else {
 +            None
 +        };
  
      let run_ignored = getopts::opt_present(&matches, "ignored");