Repository: clap-rs/clap
Pull request #4278 (2022-09-28 20:07:19)

fix(complete): Fix zsh handling of multiple arguments
In zsh completion rules, the `*` denotes whether a flag/argument is allowed multiple times or not. However, in clap 4.0.0, all flag/option rules are always marked with `*` even if it makes no sense to supply them multiple times, such as `--help`.

This regressed for flags/options in 6f03b4f948af4d862db3343a1fd8b48454404a2f, the logic for handling non-multiple arguments with zsh was simply thrown out. While the consequences of this are minor, it's discouraging to see logic discarded without an understanding of why it's there.

The printing of positional multiple args was also tweaked, `ValueRange::new(0..=1)` should not be treated as multiple values.



Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 26c8a0cd..834a382c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,12 +7,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 <!-- next-header -->
 ## [Unreleased] - ReleaseDate
 
-## [4.0.1] - 2022-09-28
-
-### Fixes
-
-- *(derive)* Ensure `#[clap(...)]` attribute still works
-
 ## [4.0.0] - 2022-09-28
 
 ### Highlights
@@ -3853,8 +3847,7 @@ Minimum version of Rust is now v1.13.0 (Stable)
 * **arg**  allow lifetimes other than 'static in arguments ([9e8c1fb9](https://github.com/clap-rs/clap/commit/9e8c1fb9406f8448873ca58bab07fe905f1551e5))
 
 <!-- next-url -->
-[Unreleased]: https://github.com/clap-rs/clap/compare/v4.0.1...HEAD
-[4.0.1]: https://github.com/clap-rs/clap/compare/v4.0.0...v4.0.1
+[Unreleased]: https://github.com/clap-rs/clap/compare/v4.0.0...HEAD
 [4.0.0]: https://github.com/clap-rs/clap/compare/v3.2.18...v4.0.0
 [3.2.18]: https://github.com/clap-rs/clap/compare/v3.2.17...v3.2.18
 [3.2.17]: https://github.com/clap-rs/clap/compare/v3.2.16...v3.2.17
diff --git a/Cargo.lock b/Cargo.lock
index ab98e244..d54aee78 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -110,7 +110,7 @@ dependencies = [
 
 [[package]]
 name = "clap"
-version = "4.0.1"
+version = "4.0.0"
 dependencies = [
  "atty",
  "backtrace",
@@ -137,7 +137,7 @@ dependencies = [
 name = "clap_bench"
 version = "0.0.0"
 dependencies = [
- "clap 4.0.1",
+ "clap 4.0.0",
  "criterion",
  "lazy_static",
 ]
@@ -146,7 +146,7 @@ dependencies = [
 name = "clap_complete"
 version = "4.0.0"
 dependencies = [
- "clap 4.0.1",
+ "clap 4.0.0",
  "clap_lex",
  "is_executable",
  "os_str_bytes",
@@ -161,14 +161,14 @@ dependencies = [
 name = "clap_complete_fig"
 version = "4.0.0"
 dependencies = [
- "clap 4.0.1",
+ "clap 4.0.0",
  "clap_complete",
  "snapbox",
 ]
 
 [[package]]
 name = "clap_derive"
-version = "4.0.1"
+version = "4.0.0"
 dependencies = [
  "heck",
  "proc-macro-error",
@@ -186,9 +186,9 @@ dependencies = [
 
 [[package]]
 name = "clap_mangen"
-version = "0.2.1"
+version = "0.2.0"
 dependencies = [
- "clap 4.0.1",
+ "clap 4.0.0",
  "roff",
  "snapbox",
 ]
diff --git a/Cargo.toml b/Cargo.toml
index 12fa1de8..cc4b9745 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,7 +10,7 @@ members = [
 
 [package]
 name = "clap"
-version = "4.0.1"
+version = "4.0.0"
 description = "A simple to use, efficient, and full-featured Command Line Argument Parser"
 repository = "https://github.com/clap-rs/clap"
 categories = ["command-line-interface"]
@@ -91,7 +91,7 @@ unstable-v5 = ["clap_derive?/unstable-v5", "deprecated"]
 bench = false
 
 [dependencies]
-clap_derive = { path = "./clap_derive", version = "=4.0.1", optional = true }
+clap_derive = { path = "./clap_derive", version = "=4.0.0", optional = true }
 clap_lex = { path = "./clap_lex", version = "0.3.0" }
 bitflags = "1.2"
 unicase = { version = "2.6", optional = true }
diff --git a/clap_complete/examples/completion-derive.rs b/clap_complete/examples/completion-derive.rs
index bbaaf25f..75177957 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(long, value_hint = ValueHint::Hostname)]
+    #[arg(short, 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 cf3d315a..bb8bf420 100644
--- a/clap_complete/examples/completion.rs
+++ b/clap_complete/examples/completion.rs
@@ -79,6 +79,7 @@ fn build_cli() -> Command {
         )
         .arg(
             Arg::new("host")
+                .short('h')
                 .long("host")
                 .value_hint(ValueHint::Hostname),
         )
diff --git a/clap_complete/src/shells/zsh.rs b/clap_complete/src/shells/zsh.rs
index 894b5f14..d4fc63ba 100644
--- a/clap_complete/src/shells/zsh.rs
+++ b/clap_complete/src/shells/zsh.rs
@@ -449,7 +449,11 @@ fn write_opts_of(p: &Command, p_global: Option<&Command>) -> String {
         let help = escape_help(&o.get_help().unwrap_or_default().to_string());
         let conflicts = arg_conflicts(p, o, p_global);
 
-        let multiple = "*";
+        let multiple = if let ArgAction::Count | ArgAction::Append = o.get_action() {
+            "*"
+        } else {
+            ""
+        };
 
         let vn = match o.get_value_names() {
             None => " ".to_string(),
@@ -545,7 +549,11 @@ fn write_flags_of(p: &Command, p_global: Option<&Command>) -> String {
         let help = escape_help(&f.get_help().unwrap_or_default().to_string());
         let conflicts = arg_conflicts(p, &f, p_global);
 
-        let multiple = "*";
+        let multiple = if let ArgAction::Count | ArgAction::Append = f.get_action() {
+            "*"
+        } else {
+            ""
+        };
 
         if let Some(short) = f.get_short() {
             let s = format!(
@@ -620,14 +628,13 @@ fn write_positionals_of(p: &Command) -> String {
         debug!("write_positionals_of:iter: arg={}", arg.get_id());
 
         let num_args = arg.get_num_args().expect("built");
-        let cardinality =
-            if num_args != builder::ValueRange::EMPTY && num_args != builder::ValueRange::SINGLE {
-                "*:"
-            } else if !arg.is_required_set() {
-                ":"
-            } else {
-                ""
-            };
+        let cardinality = if num_args.max_values() > 1 {
+            "*:"
+        } else if !arg.is_required_set() {
+            ":"
+        } else {
+            ""
+        };
 
         let a = format!(
             "'{cardinality}:{name}{help}:{value_completion}' \\",
diff --git a/clap_derive/Cargo.toml b/clap_derive/Cargo.toml
index 13a48a3f..e1379cf9 100644
--- a/clap_derive/Cargo.toml
+++ b/clap_derive/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "clap_derive"
-version = "4.0.1"
+version = "4.0.0"
 description = "Parse command line argument by defining a struct, derive crate."
 repository = "https://github.com/clap-rs/clap/tree/master/clap_derive"
 categories = ["command-line-interface", "development-tools::procedural-macro-helpers"]
diff --git a/clap_derive/README.md b/clap_derive/README.md
index 4d0bde40..e358a7eb 100644
--- a/clap_derive/README.md
+++ b/clap_derive/README.md
@@ -3,8 +3,8 @@
 Macro implementation for clap's derives.
 
 [docs.rs](https://docs.rs/clap)
-- [Derive Tutorial](https://github.com/clap-rs/clap/blob/v4.0.1/examples/tutorial_derive/README.md)
-- [Derive Reference](https://github.com/clap-rs/clap/blob/v4.0.1/examples/derive_ref/README.md)
+- [Derive Tutorial](https://github.com/clap-rs/clap/blob/v4.0.0/examples/tutorial_derive/README.md)
+- [Derive Reference](https://github.com/clap-rs/clap/blob/v4.0.0/examples/derive_ref/README.md)
 
 ## License
 
diff --git a/clap_derive/src/item.rs b/clap_derive/src/item.rs
index 758df901..627d11b5 100644
--- a/clap_derive/src/item.rs
+++ b/clap_derive/src/item.rs
@@ -1261,12 +1261,10 @@ impl ToTokens for Deprecation {
 }
 
 fn assert_attr_kind(attr: &ClapAttr, possible_kind: &[AttrKind]) {
-    if *attr.kind.get() == AttrKind::Clap || *attr.kind.get() == AttrKind::StructOpt {
-        // deprecated
-    } else if !possible_kind.contains(attr.kind.get()) {
+    if !possible_kind.contains(attr.kind.get()) {
         let options = possible_kind
             .iter()
-            .map(|k| format!("`#[{}({})]`", k.as_str(), attr.name))
+            .map(|k| format!("`#[{}({})]", k.as_str(), attr.name))
             .collect::<Vec<_>>();
         abort!(
             attr.name,
diff --git a/clap_mangen/CHANGELOG.md b/clap_mangen/CHANGELOG.md
index 96f8611d..9c194b44 100644
--- a/clap_mangen/CHANGELOG.md
+++ b/clap_mangen/CHANGELOG.md
@@ -7,12 +7,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 <!-- next-header -->
 ## [Unreleased] - ReleaseDate
 
-## [0.2.1] - 2022-09-28
-
-### Fixes
-
-- Respect hide attributes in more cases
-
 ## [0.2.0] - 2022-09-28
 
 ## [0.1.10] - 2022-06-28
@@ -48,8 +42,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 - Expanded the documentation
 
 <!-- next-url -->
-[Unreleased]: https://github.com/clap-rs/clap/compare/clap_mangen-v0.2.1...HEAD
-[0.2.1]: https://github.com/clap-rs/clap/compare/clap_mangen-v0.2.0...clap_mangen-v0.2.1
+[Unreleased]: https://github.com/clap-rs/clap/compare/clap_mangen-v0.2.0...HEAD
 [0.2.0]: https://github.com/clap-rs/clap/compare/clap_mangen-v0.1.10...clap_mangen-v0.2.0
 [0.1.10]: https://github.com/clap-rs/clap/compare/clap_mangen-v0.1.9...clap_mangen-v0.1.10
 [0.1.9]: https://github.com/clap-rs/clap/compare/clap_mangen-v0.1.8...clap_mangen-v0.1.9
diff --git a/clap_mangen/Cargo.toml b/clap_mangen/Cargo.toml
index 9bb6abbc..20b08a81 100644
--- a/clap_mangen/Cargo.toml
+++ b/clap_mangen/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "clap_mangen"
-version = "0.2.1"
+version = "0.2.0"
 description = "A manpage generator for clap"
 repository = "https://github.com/clap-rs/clap/tree/master/clap_mangen"
 categories = ["command-line-interface"]
diff --git a/clap_mangen/README.md b/clap_mangen/README.md
index b649aee5..21a2e237 100644
--- a/clap_mangen/README.md
+++ b/clap_mangen/README.md
@@ -5,16 +5,16 @@
 
 [![Crates.io](https://img.shields.io/crates/v/clap_mangen?style=flat-square)](https://crates.io/crates/clap_mangen)
 [![Crates.io](https://img.shields.io/crates/d/clap_mangen?style=flat-square)](https://crates.io/crates/clap_mangen)
-[![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_mangen-v0.2.1/LICENSE-APACHE)
-[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_mangen-v0.2.1/LICENSE-MIT)
+[![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_mangen-v0.2.0/LICENSE-APACHE)
+[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_mangen-v0.2.0/LICENSE-MIT)
 
 Dual-licensed under [Apache 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT).
 
 1. [About](#about)
 2. [API Reference](https://docs.rs/clap_mangen)
 3. [Questions & Discussions](https://github.com/clap-rs/clap/discussions)
-4. [CONTRIBUTING](https://github.com/clap-rs/clap/blob/clap_mangen-v0.2.1/clap_mangen/CONTRIBUTING.md)
-5. [Sponsors](https://github.com/clap-rs/clap/blob/clap_mangen-v0.2.1/README.md#sponsors)
+4. [CONTRIBUTING](https://github.com/clap-rs/clap/blob/clap_mangen-v0.2.0/clap_mangen/CONTRIBUTING.md)
+5. [Sponsors](https://github.com/clap-rs/clap/blob/clap_mangen-v0.2.0/README.md#sponsors)
 
 ## About
 


Test patch:
diff --git a/clap_complete/tests/snapshots/aliases.zsh b/clap_complete/tests/snapshots/aliases.zsh
index dcb879cb..b97cde41 100644
--- a/clap_complete/tests/snapshots/aliases.zsh
+++ b/clap_complete/tests/snapshots/aliases.zsh
@@ -15,18 +15,18 @@ _my-app() {
 
     local context curcontext="$curcontext" state line
     _arguments "${_arguments_options[@]}" \
-'*-o+[cmd option]: : ' \
-'*-O+[cmd option]: : ' \
-'*--option=[cmd option]: : ' \
-'*--opt=[cmd option]: : ' \
-'*-f[cmd flag]' \
-'*-F[cmd flag]' \
-'*--flag[cmd flag]' \
-'*--flg[cmd flag]' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'-o+[cmd option]: : ' \
+'-O+[cmd option]: : ' \
+'--option=[cmd option]: : ' \
+'--opt=[cmd option]: : ' \
+'-f[cmd flag]' \
+'-F[cmd flag]' \
+'--flag[cmd flag]' \
+'--flg[cmd flag]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 '::positional:' \
 && ret=0
 }
diff --git a/clap_complete/tests/snapshots/basic.zsh b/clap_complete/tests/snapshots/basic.zsh
index 6da2ae45..56959696 100644
--- a/clap_complete/tests/snapshots/basic.zsh
+++ b/clap_complete/tests/snapshots/basic.zsh
@@ -15,10 +15,10 @@ _my-app() {
 
     local context curcontext="$curcontext" state line
     _arguments "${_arguments_options[@]}" \
-'*-c[]' \
-'(-c)*-v[]' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
+'-c[]' \
+'(-c)-v[]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
 ":: :_my-app_commands" \
 "*::: :->my-app" \
 && ret=0
@@ -31,9 +31,9 @@ _my-app() {
             (test)
 _arguments "${_arguments_options[@]}" \
 '*-d[]' \
-'*-c[]' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
+'-c[]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
 && ret=0
 ;;
 (help)
diff --git a/clap_complete/tests/snapshots/feature_sample.zsh b/clap_complete/tests/snapshots/feature_sample.zsh
index 88e89600..4bc3c3aa 100644
--- a/clap_complete/tests/snapshots/feature_sample.zsh
+++ b/clap_complete/tests/snapshots/feature_sample.zsh
@@ -19,10 +19,10 @@ _my-app() {
 '*-C[some config file]' \
 '*--config[some config file]' \
 '*--conf[some config file]' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 '::file -- some input file:_files' \
 '::choice:(first second)' \
 ":: :_my-app_commands" \
@@ -36,11 +36,11 @@ _my-app() {
         case $line[3] in
             (test)
 _arguments "${_arguments_options[@]}" \
-'*--case=[the case to test]: : ' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'--case=[the case to test]: : ' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 && ret=0
 ;;
 (help)
diff --git a/clap_complete/tests/snapshots/quoting.zsh b/clap_complete/tests/snapshots/quoting.zsh
index 3ff1a256..d8d9c21b 100644
--- a/clap_complete/tests/snapshots/quoting.zsh
+++ b/clap_complete/tests/snapshots/quoting.zsh
@@ -15,16 +15,16 @@ _my-app() {
 
     local context curcontext="$curcontext" state line
     _arguments "${_arguments_options[@]}" \
-'*--single-quotes[Can be '\''always'\'', '\''auto'\'', or '\''never'\'']' \
-'*--double-quotes[Can be "always", "auto", or "never"]' \
-'*--backticks[For more information see `echo test`]' \
-'*--backslash[Avoid '\''\\n'\'']' \
-'*--brackets[List packages \[filter\]]' \
-'*--expansions[Execute the shell command with $SHELL]' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'--single-quotes[Can be '\''always'\'', '\''auto'\'', or '\''never'\'']' \
+'--double-quotes[Can be "always", "auto", or "never"]' \
+'--backticks[For more information see `echo test`]' \
+'--backslash[Avoid '\''\\n'\'']' \
+'--brackets[List packages \[filter\]]' \
+'--expansions[Execute the shell command with $SHELL]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 ":: :_my-app_commands" \
 "*::: :->my-app" \
 && ret=0
@@ -36,38 +36,38 @@ _my-app() {
         case $line[1] in
             (cmd-single-quotes)
 _arguments "${_arguments_options[@]}" \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
 && ret=0
 ;;
 (cmd-double-quotes)
 _arguments "${_arguments_options[@]}" \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
 && ret=0
 ;;
 (cmd-backticks)
 _arguments "${_arguments_options[@]}" \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
 && ret=0
 ;;
 (cmd-backslash)
 _arguments "${_arguments_options[@]}" \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
 && ret=0
 ;;
 (cmd-brackets)
 _arguments "${_arguments_options[@]}" \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
 && ret=0
 ;;
 (cmd-expansions)
 _arguments "${_arguments_options[@]}" \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
 && ret=0
 ;;
 (help)
diff --git a/clap_complete/tests/snapshots/special_commands.zsh b/clap_complete/tests/snapshots/special_commands.zsh
index 37a00471..0d0ced68 100644
--- a/clap_complete/tests/snapshots/special_commands.zsh
+++ b/clap_complete/tests/snapshots/special_commands.zsh
@@ -19,10 +19,10 @@ _my-app() {
 '*-C[some config file]' \
 '*--config[some config file]' \
 '*--conf[some config file]' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 '::file -- some input file:_files' \
 '::choice:(first second)' \
 ":: :_my-app_commands" \
@@ -36,37 +36,37 @@ _my-app() {
         case $line[3] in
             (test)
 _arguments "${_arguments_options[@]}" \
-'*--case=[the case to test]: : ' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'--case=[the case to test]: : ' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 && ret=0
 ;;
 (some_cmd)
 _arguments "${_arguments_options[@]}" \
-'*--config=[the other case to test]: : ' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'--config=[the other case to test]: : ' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 '*::path:' \
 && ret=0
 ;;
 (some-cmd-with-hyphens)
 _arguments "${_arguments_options[@]}" \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 && ret=0
 ;;
 (some-hidden-cmd)
 _arguments "${_arguments_options[@]}" \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 && ret=0
 ;;
 (help)
diff --git a/clap_complete/tests/snapshots/sub_subcommands.zsh b/clap_complete/tests/snapshots/sub_subcommands.zsh
index be4378d7..922613ba 100644
--- a/clap_complete/tests/snapshots/sub_subcommands.zsh
+++ b/clap_complete/tests/snapshots/sub_subcommands.zsh
@@ -19,10 +19,10 @@ _my-app() {
 '*-C[some config file]' \
 '*--config[some config file]' \
 '*--conf[some config file]' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 '::file -- some input file:_files' \
 '::choice:(first second)' \
 ":: :_my-app_commands" \
@@ -36,19 +36,19 @@ _my-app() {
         case $line[3] in
             (test)
 _arguments "${_arguments_options[@]}" \
-'*--case=[the case to test]: : ' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'--case=[the case to test]: : ' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 && ret=0
 ;;
 (some_cmd)
 _arguments "${_arguments_options[@]}" \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'-h[Print help information]' \
+'--help[Print help information]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 ":: :_my-app__some_cmd_commands" \
 "*::: :->some_cmd" \
 && ret=0
@@ -61,12 +61,12 @@ _arguments "${_arguments_options[@]}" \
         case $line[1] in
             (sub_cmd)
 _arguments "${_arguments_options[@]}" \
-'*--config=[the other case to test]: :((Lest\ quotes,\ aren'\''t\ escaped.\:"help,with,comma"
+'--config=[the other case to test]: :((Lest\ quotes,\ aren'\''t\ escaped.\:"help,with,comma"
 Second\ to\ trigger\ display\ of\ options\:""))' \
-'*-h[Print help information (use `--help` for more detail)]' \
-'*--help[Print help information (use `--help` for more detail)]' \
-'*-V[Print version information]' \
-'*--version[Print version information]' \
+'-h[Print help information (use `--help` for more detail)]' \
+'--help[Print help information (use `--help` for more detail)]' \
+'-V[Print version information]' \
+'--version[Print version information]' \
 && ret=0
 ;;
 (help)
diff --git a/clap_complete/tests/snapshots/value_hint.zsh b/clap_complete/tests/snapshots/value_hint.zsh
index 3db2f312..d865e4ca 100644
--- a/clap_complete/tests/snapshots/value_hint.zsh
+++ b/clap_complete/tests/snapshots/value_hint.zsh
@@ -15,28 +15,28 @@ _my-app() {
 
     local context curcontext="$curcontext" state line
     _arguments "${_arguments_options[@]}" \
-'*--choice=[]: :(bash fish zsh)' \
-'*--unknown=[]: : ' \
-'*--other=[]: :( )' \
-'*-p+[]: :_files' \
-'*--path=[]: :_files' \
-'*-f+[]: :_files' \
-'*--file=[]: :_files' \
-'*-d+[]: :_files -/' \
-'*--dir=[]: :_files -/' \
-'*-e+[]: :_absolute_command_paths' \
-'*--exe=[]: :_absolute_command_paths' \
-'*--cmd-name=[]: :_command_names -e' \
-'*-c+[]: :_cmdstring' \
-'*--cmd=[]: :_cmdstring' \
-'*-u+[]: :_users' \
-'*--user=[]: :_users' \
-'*-H+[]: :_hosts' \
-'*--host=[]: :_hosts' \
-'*--url=[]: :_urls' \
-'*--email=[]: :_email_addresses' \
-'*-h[Print help information]' \
-'*--help[Print help information]' \
+'--choice=[]: :(bash fish zsh)' \
+'--unknown=[]: : ' \
+'--other=[]: :( )' \
+'-p+[]: :_files' \
+'--path=[]: :_files' \
+'-f+[]: :_files' \
+'--file=[]: :_files' \
+'-d+[]: :_files -/' \
+'--dir=[]: :_files -/' \
+'-e+[]: :_absolute_command_paths' \
+'--exe=[]: :_absolute_command_paths' \
+'--cmd-name=[]: :_command_names -e' \
+'-c+[]: :_cmdstring' \
+'--cmd=[]: :_cmdstring' \
+'-u+[]: :_users' \
+'--user=[]: :_users' \
+'-H+[]: :_hosts' \
+'--host=[]: :_hosts' \
+'--url=[]: :_urls' \
+'--email=[]: :_email_addresses' \
+'-h[Print help information]' \
+'--help[Print help information]' \
 '*::command_with_args:_cmdambivalent' \
 && ret=0
 }