Skip to content

Commit

Permalink
fix(Usage Strings): removes duplicate groups from usage strings
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed May 9, 2016
1 parent deac597 commit f574fb8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,15 @@ impl<'a, 'b> Parser<'a, 'b>
}
write_arg!(self.flags.iter(), matcher, c_flags, ret_val);
write_arg!(self.opts.iter(), matcher, c_opt, ret_val);
let mut g_vec = vec![];
for g in grps.into_iter() {
let g_string = self.args_in_group(g)
.join("|");
ret_val.push_back(format!("<{}>", &g_string[..g_string.len()]));
g_vec.push(format!("<{}>", &g_string[..g_string.len()]));
}
g_vec.dedup();
for g in g_vec.into_iter() {
ret_val.push_back(g);
}

ret_val
Expand Down

0 comments on commit f574fb8

Please sign in to comment.