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

Issue:
clap_complete v4 panics in debug mode when generating
### 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.64.0 (a55dd71d5 2022-09-19)

### Clap Version

4.0.0

### Minimal reproducible code

completion-derive example: https://github.com/clap-rs/clap/blob/master/clap_complete/examples/completion-derive.rs

### Steps to reproduce the bug with the above code

```sh
cargo run --example completion-derive -- --generate=bash
```

### Actual Behaviour

```sh
$ RUST_BACKTRACE=1 cargo run --example completion-derive -- --generate=bash
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `/home/alex/.cargo/target/debug/examples/completion-derive --generate=bash`
thread 'main' panicked at 'Command value_hints_derive: Short option names must be unique for each argument, but '-h' is in use by both 'host' and 'help' (call `cmd.disable_help_flag(true)` to remove the auto-generated `--help`)', src/builder/debug_asserts.rs:121:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: clap::builder::debug_asserts::assert_app
             at /home/alex/project/clap/src/builder/debug_asserts.rs:121:17
   3: clap::builder::command::Command::_build_self
             at /home/alex/project/clap/src/builder/command.rs:3898:13
   4: clap::builder::command::Command::_do_parse
             at /home/alex/project/clap/src/builder/command.rs:3768:9
   5: clap::builder::command::Command::try_get_matches_from_mut
             at /home/alex/project/clap/src/builder/command.rs:708:9
   6: clap::builder::command::Command::get_matches_from
             at /home/alex/project/clap/src/builder/command.rs:578:9
   7: clap::builder::command::Command::get_matches
             at /home/alex/project/clap/src/builder/command.rs:490:9
   8: clap::derive::Parser::parse
             at /home/alex/project/clap/src/derive.rs:82:27
   9: completion_derive::main
             at ./examples/completion-derive.rs:62:15
  10: core::ops::function::FnOnce::call_once
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
```

### Expected Behaviour

It should not panic.

No panics in release mode and the output seems to be correct too.

### Additional Context

_No response_

### Debug Output

```
[      clap::builder::command]  Command::_do_parse
[      clap::builder::command]  Command::_build: name="value_hints_derive"
[      clap::builder::command]  Command::_propagate:value_hints_derive
[      clap::builder::command]  Command::_check_help_and_version:value_hints_derive expand_help_tree=false
[      clap::builder::command]  Command::long_help_exists
[      clap::builder::command]  Command::_check_help_and_version: Building default --help
[      clap::builder::command]  Command::_propagate_global_args:value_hints_derive
[clap::builder::debug_asserts]  Command::_debug_asserts
[clap::builder::debug_asserts]  Arg::_debug_asserts:generator
[clap::builder::debug_asserts]  Arg::_debug_asserts:unknown
[clap::builder::debug_asserts]  Arg::_debug_asserts:other
[clap::builder::debug_asserts]  Arg::_debug_asserts:path
[clap::builder::debug_asserts]  Arg::_debug_asserts:file
[clap::builder::debug_asserts]  Arg::_debug_asserts:dir
[clap::builder::debug_asserts]  Arg::_debug_asserts:exe
[clap::builder::debug_asserts]  Arg::_debug_asserts:cmd_name
[clap::builder::debug_asserts]  Arg::_debug_asserts:cmd
[clap::builder::debug_asserts]  Arg::_debug_asserts:command_with_args
[clap::builder::debug_asserts]  Arg::_debug_asserts:user
[clap::builder::debug_asserts]  Arg::_debug_asserts:host
thread 'main' panicked at 'Command value_hints_derive: Short option names must be unique for each argument, but '-h' is in use by both 'host' and 'help' (call `cmd.disable_help_flag(true)` to remove the auto-generated `--help`)', src/builder/debug_asserts.rs:121:17
```


Discussion / hints:

Fix patch:
diff --git a/clap_complete/examples/completion-derive.rs b/clap_complete/examples/completion-derive.rs
index 75177957623..bbaaf25fa46 100644
--- a/clap_complete/examples/completion-derive.rs
+++ b/clap_complete/examples/completion-derive.rs
@@ -46,7 +46,7 @@ struct Opt {
     command_with_args: Vec<String>,
     #[arg(short, long, value_hint = ValueHint::Username)]
     user: Option<String>,
-    #[arg(short, long, value_hint = ValueHint::Hostname)]
+    #[arg(long, value_hint = ValueHint::Hostname)]
     host: Option<String>,
     #[arg(long, value_hint = ValueHint::Url)]
     url: Option<String>,
diff --git a/clap_complete/examples/completion.rs b/clap_complete/examples/completion.rs
index bb8bf420038..cf3d315a9f1 100644
--- a/clap_complete/examples/completion.rs
+++ b/clap_complete/examples/completion.rs
@@ -79,7 +79,6 @@ fn build_cli() -> Command {
         )
         .arg(
             Arg::new("host")
-                .short('h')
                 .long("host")
                 .value_hint(ValueHint::Hostname),
         )


Test patch: