mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
fix: Don't panic on non-built arg rendering
For num_args, we'll just use the default Fixes #4479
This commit is contained in:
parent
95144b7590
commit
c939de8a25
1 changed files with 1 additions and 1 deletions
|
@ -4183,7 +4183,7 @@ impl Arg {
|
|||
fn render_arg_val(&self, required: bool) -> String {
|
||||
let mut rendered = String::new();
|
||||
|
||||
let num_vals = self.get_num_args().expect(INTERNAL_ERROR_MSG);
|
||||
let num_vals = self.get_num_args().unwrap_or_else(|| 1.into());
|
||||
|
||||
let mut val_names = if self.val_names.is_empty() {
|
||||
vec![self.id.as_internal_str().to_owned()]
|
||||
|
|
Loading…
Reference in a new issue