Skip to content

Commit

Permalink
fix: fixes a bug when parsing multiple {n} newlines inside help strings
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Jul 17, 2015
1 parent f2dd2cb commit 6d214b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "clap"
version = "1.1.1"
version = "1.1.2"
authors = ["Kevin K. <[email protected]>"]
exclude = ["examples/*", "clap-tests/*"]
description = "A simple to use, efficient, and full featured Command Line Argument Parser"
Expand Down
8 changes: 6 additions & 2 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ macro_rules! print_opt_help {
if let Some(h) = $opt.help {
if h.contains("{n}") {
let mut hel = h.split("{n}");
if let Some(part) = hel.next() {
print!("{}", part);
}
while let Some(part) = hel.next() {
print!("{}\n", part);
print!("\n");
$me.print_spaces($spc);
print!("{}", hel.next().unwrap_or(""));
print!("{}", part);
// print!("{}", hel.next().unwrap_or(""));
}
} else {
print!("{}", h);
Expand Down

0 comments on commit 6d214b5

Please sign in to comment.