Skip to content

Commit

Permalink
Do not enforce two newlines after the options
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jul 30, 2013
1 parent 576f395 commit f7ebab4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/compiletest/compiletest.rs
Expand Up @@ -85,6 +85,7 @@ pub fn parse_config(args: ~[~str]) -> config {
if args[1] == ~"-h" || args[1] == ~"--help" {
let message = fmt!("Usage: %s [OPTIONS] [TESTNAME...]", argv0);
println(getopts::groups::usage(message, groups));
println("");
fail!()
}

Expand All @@ -97,6 +98,7 @@ pub fn parse_config(args: ~[~str]) -> config {
if getopts::opt_present(matches, "h") || getopts::opt_present(matches, "help") {
let message = fmt!("Usage: %s [OPTIONS] [TESTNAME...]", argv0);
println(getopts::groups::usage(message, groups));
println("");
fail!()
}

Expand Down
4 changes: 1 addition & 3 deletions src/libextra/getopts.rs
Expand Up @@ -680,7 +680,7 @@ pub mod groups {
return brief.to_owned() +
"\n\nOptions:\n" +
rows.collect::<~[~str]>().connect("\n") +
"\n\n";
"\n";
}

/** Splits a string into substrings with possibly internal whitespace,
Expand Down Expand Up @@ -1463,7 +1463,6 @@ Options:
-k --kiwi Desc
-p [VAL] Desc
-l VAL Desc

";
let generated_usage = groups::usage("Usage: fruits", optgroups);
Expand Down Expand Up @@ -1492,7 +1491,6 @@ Options:
-k --kiwi This is a long description which won't be wrapped..+..
-a --apple This is a long description which _will_ be
wrapped..+..

";
let usage = groups::usage("Usage: fruits", optgroups);
Expand Down
1 change: 1 addition & 0 deletions src/libextra/test.rs
Expand Up @@ -191,6 +191,7 @@ fn optgroups() -> ~[getopts::groups::OptGroup] {
fn usage(binary: &str, helpstr: &str) -> ! {
let message = fmt!("Usage: %s [OPTIONS] [FILTER]", binary);
println(groups::usage(message, optgroups()));
println("");
if helpstr == "help" {
println("\
The FILTER is matched against the name of all tests to run, and if any tests
Expand Down

5 comments on commit f7ebab4

@bors
Copy link
Contributor

@bors bors commented on f7ebab4 Jul 30, 2013

Choose a reason for hiding this comment

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

saw approval from brson
at Seldaek@f7ebab4

@bors
Copy link
Contributor

@bors bors commented on f7ebab4 Jul 30, 2013

Choose a reason for hiding this comment

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

merging Seldaek/rust/getopt_usage_newline = f7ebab4 into auto

@bors
Copy link
Contributor

@bors bors commented on f7ebab4 Jul 30, 2013

Choose a reason for hiding this comment

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

Seldaek/rust/getopt_usage_newline = f7ebab4 merged ok, testing candidate = 0068bd7

@bors
Copy link
Contributor

@bors bors commented on f7ebab4 Jul 30, 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 = 0068bd7

Please sign in to comment.