fix(Usage Strings): removes duplicate groups from usage strings

This commit is contained in:
Kevin K 2016-05-09 15:32:35 -04:00
parent deac597fc6
commit f574fb8a7c

View file

@ -324,10 +324,15 @@ impl<'a, 'b> Parser<'a, 'b>
} }
write_arg!(self.flags.iter(), matcher, c_flags, ret_val); write_arg!(self.flags.iter(), matcher, c_flags, ret_val);
write_arg!(self.opts.iter(), matcher, c_opt, ret_val); write_arg!(self.opts.iter(), matcher, c_opt, ret_val);
let mut g_vec = vec![];
for g in grps.into_iter() { for g in grps.into_iter() {
let g_string = self.args_in_group(g) let g_string = self.args_in_group(g)
.join("|"); .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 ret_val