Repository: clap-rs/clap (language: rust)

Issue:
Printing an argument from `get_positionals()` panicks with "Fatal internal error"
### Please complete the following tasks

- [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
- [X] I have searched the [open](https://github.com/clap-rs/clap/issues) and [rejected](https://github.com/clap-rs/clap/issues?q=is%3Aissue+label%3AS-wont-fix+is%3Aclosed) issues

### Rust Version

rustc 1.65.0 (897e37553 2022-11-02)

### Clap Version

4.0.23

### Minimal reproducible code

```rust
use clap::{Command, Arg};

fn main() {
    env_logger::init();
    let command = Command::new("App Name").arg(Arg::new("arg"));
    let positionals = command.get_positionals();
    for arg in positionals {
        println!("arg: {arg}");
    }
}
```

### Steps to reproduce the bug with the above code

Running `cargo run` is enough to trigger the fatal error.

### Actual Behaviour

Panics when it is about to print an argument.
```
thread 'main' panicked at 'Fatal internal error. Please consider filing a bug report at https://github.com/clap-rs/clap/issues', /home/sami/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.0.23/src/builder/arg.rs:4186:44
stack backtrace:
   0: rust_begin_unwind
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
   2: core::panicking::panic_display
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:72:5
   3: core::panicking::panic_str
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:56:5
   4: core::option::expect_failed
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/option.rs:1880:5
   5: core::option::Option<T>::expect
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/option.rs:738:21
   6: clap::builder::arg::Arg::render_arg_val
             at /home/sami/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.0.23/src/builder/arg.rs:4186:24
   7: clap::builder::arg::Arg::stylize_arg_suffix
             at /home/sami/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.0.23/src/builder/arg.rs:4170:27
   8: clap::builder::arg::Arg::stylized
             at /home/sami/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.0.23/src/builder/arg.rs:4144:23
   9: <clap::builder::arg::Arg as core::fmt::Display>::fmt
             at /home/sami/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-4.0.23/src/builder/arg.rs:4264:9
  10: <&T as core::fmt::Display>::fmt
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/fmt/mod.rs:2366:62
  11: core::fmt::write
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/fmt/mod.rs:1202:17
  12: std::io::Write::write_fmt
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/io/mod.rs:1679:15
  13: <&std::io::stdio::Stdout as std::io::Write>::write_fmt
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/io/stdio.rs:715:9
  14: <std::io::stdio::Stdout as std::io::Write>::write_fmt
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/io/stdio.rs:689:9
  15: std::io::stdio::print_to
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/io/stdio.rs:1017:21
  16: std::io::stdio::_print
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/io/stdio.rs:1030:5
  17: auto_i18n::main
             at ./src/main.rs:7:9
  18: core::ops::function::FnOnce::call_once
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```

### Expected Behaviour

Printed positional arguments. I don't know if the code makes sense or not as I don't quite know how clap works. I was merely experimenting.

### Additional Context

_No response_

### Debug Output

_No response_


Discussion / hints:

Fix patch:
diff --git a/src/builder/arg.rs b/src/builder/arg.rs
index 241fe257cfa..17db059af8f 100644
--- a/src/builder/arg.rs
+++ b/src/builder/arg.rs
@@ -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()]


Test patch: