Skip to content

Commit

Permalink
Fix(usage): don't print defaults of required positionals
Browse files Browse the repository at this point in the history
  • Loading branch information
ulidtko committed Dec 24, 2020
1 parent 571a98d commit 9993b0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,8 @@ impl Parser {
if self.wants_help() {
let def = into.to_string();
self.printer.add_positional(printer::Positional::new(
name, desc, if def.is_empty() { None } else { Some(def) },
name, desc,
if def.is_empty() || required { None } else { Some(def) },
required, false
))?;
return Ok(self);
Expand Down

0 comments on commit 9993b0f

Please sign in to comment.