Repository: sharkdp/fd (language: rust)

Issue:
[BUG] Doc comment for `ColorWhen` breaks completions for the fish shell
### Checks

- [X] I have read the troubleshooting section and still think this is a bug.

### Describe the bug you encountered:

Trying to use tab completion for fd's `--color` option displays an error:

```
$ fd --color=<TAB>fish: Unknown command: default
fish: 
default
^~~~~~^
in command substitution
```

I believe this doc comment is the culprit:

https://github.com/sharkdp/fd/blob/a248607beefac2137cbe068ef74898c46e0705dd/src/cli.rs#L734-L736

The relevant line in the generated fish completions is this one:

```fish
complete -c fd -s c -l color -d 'When to use colors' -r -f -a "{auto	show colors if the output goes to an interactive console (default),always	always use colorized output,never	do not use colorized output}"
```

Because there are parentheses around the word "default", fish will launch a subshell. But when fish does so, it can't find the `default` program and displays an error.

### Possible solutions:
1. Change the parentheses to brackets or something.
1. Patch clap / clap_complete to escape parentheses in doc comments.

### Describe what you expected to happen:

I expect to see the possible completions:

```
$ fd --color=<TAB>
always                                       (always use colorized output)
auto  (show colors if the output goes to an interactive console (default))
never                                        (do not use colorized output)
```

### What version of `fd` are you using?

fd 8.7.0

### Which operating system / distribution are you on?

```shell
Darwin 22.6.0 arm64
```



Discussion / hints:
I think this should be fixed in clap_complete
Agreed. Clap_complete should escape special characters in the description. Could you open an issue with clap?

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 8d7410147..74384f5b0 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -128,9 +128,9 @@ dependencies = [
 
 [[package]]
 name = "clap_complete"
-version = "4.4.0"
+version = "4.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "586a385f7ef2f8b4d86bddaa0c094794e7ccbfe5ffef1f434fe928143fc783a5"
+checksum = "4110a1e6af615a9e6d0a36f805d5c99099f8bab9b8042f5bc1fa220a4a89e36f"
 dependencies = [
  "clap",
 ]
diff --git a/Cargo.toml b/Cargo.toml
index 7db25a072..176008c14 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -47,7 +47,7 @@ anyhow = "1.0"
 etcetera = "0.8"
 normpath = "1.1.1"
 crossbeam-channel = "0.5.8"
-clap_complete = {version = "4.4.0", optional = true}
+clap_complete = {version = "4.4.1", optional = true}
 faccess = "0.2.4"
 
 [dependencies.clap]


Test patch: