Skip to content

Commit b376b39

Browse files
fix(zsh): fix completion generation for zsh (#9082)
### Description Fixes #9080 Upgrade `clap` and completion generation to get clap-rs/clap#5545 Also change the long flag name from `--[no-]daemon` to `--(no-)daemon` as `[]` are reserved chars for zsh autocompletes. ⚠️ This will break anyone who uses `--[no-]daemon` to enable the daemon. ### Testing Instructions `turbo_dev completion zsh > ~/.zsh/completions/_turbo` (or where ever your completions are stored) Open a new shell and enter `turbo -- <TAB> <TAB>` ``` [0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ turbo -- --__test-run --no-daemon --version --experimental-space-id --pkg-inference-root --dry-run -- --affected -- Run only tasks that are affected by changes between the current branch and `main` --anon-profile -- File to write turbo's performance profile output into. All identifying data omitted fr --api -- Override the endpoint for API calls --cache-dir -- Override the filesystem cache directory --cache-workers -- Set the number of concurrent cache operations (default 10) --check-for-update -- Force a check for a new version of turbo --color -- Force color usage in the terminal --concurrency -- Limit the concurrency of task execution. Use 1 for serial (i.e. one-at-a-time) executi --continue -- Continue execution even if a task exits with an error or non-zero exit code. The defau --cwd -- The directory in which to run turbo --daemon -- Force turbo to either use or not use the local daemon. If unset turbo will use the def --dangerously-disable-package-manager-check -- Allow for missing `packageManager` in `package.json` --env-mode -- Environment variable mode. Use "loose" to pass the entire existing environment. Use "s --filter -- Use the given selector to specify package(s) to act as entry points. The syntax mirror --force -- Ignore the existing cache (to force execution) --framework-inference -- Specify whether or not to do framework inference for tasks --global-deps -- Specify glob of global filesystem dependencies to be hashed. Useful for .env and files --graph -- Generate a graph of the task execution and output to a file when a filename is specifi --heap -- Specify a file to save a pprof heap profile --help -- Print help (see more with '--help') --log-order -- Set type of task output order. Use "stream" to show output as soon as it is available. --log-prefix -- Use "none" to remove prefixes from task logs. Use "task" to get task id prefixing. Use --login -- Override the login endpoint --no-cache -- Avoid saving task results to the cache. Useful for development/watch tasks --no-color -- Suppress color usage in the terminal --no-update-notifier -- Disable the turbo update notification --only -- Only executes the tasks specified, does not execute parent tasks --output-logs -- Set type of process output logging. Use "full" to show all output. Use "hash-only" to --parallel -- Execute all tasks in parallel --preflight -- When enabled, turbo will precede HTTP requests with an OPTIONS request for authorizati --profile -- File to write turbo's performance profile output into. You can load the file up in chr --remote-cache-read-only -- Treat remote cache as read only --remote-cache-timeout -- Set a timeout for all HTTP requests --remote-only -- Ignore the local filesystem cache for all tasks. Only allow reading and caching artifa --single-package -- Run turbo in single-package mode --skip-infer -- Skip any attempts to infer which version of Turbo the project is configured to use --summarize -- Generate a summary of the turbo run --team -- Set the team slug for API calls --token -- Set the auth token for API calls --trace -- Specify a file to save a pprof trace --ui -- Specify whether to use the streaming UI or TUI --verbosity -- Verbosity level ```
1 parent beb5955 commit b376b39

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

Cargo.lock

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ biome_json_syntax = { version = "0.5.7" }
111111
bytes = "1.1.0"
112112
camino = { version = "1.1.4", features = ["serde1"] }
113113
chrono = "0.4.23"
114-
clap = "4.5.2"
115-
clap_complete = "4.5.1"
114+
clap = "4.5.16"
115+
clap_complete = "4.5.24"
116116
concurrent-queue = "2.5.0"
117117
console = "0.15.5"
118118
console-subscriber = "0.1.8"

crates/turborepo-lib/src/cli/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ pub struct RunArgs {
851851
// -----------------------
852852
/// Force turbo to either use or not use the local daemon. If unset
853853
/// turbo will use the default detection logic.
854-
#[clap(long = "[no-]daemon", alias = "daemon", group = "daemon-group")]
854+
#[clap(long = "(no-)daemon", alias = "daemon", group = "daemon-group")]
855855
pub daemon: bool,
856856

857857
#[clap(long, group = "daemon-group", hide = true)]

turborepo-tests/integration/tests/conflicting-flags.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Setup
22
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
33
$ ${TURBO} run build --daemon --no-daemon
4-
ERROR the argument '--\[no-\]daemon' cannot be used with '--no-daemon' (re)
4+
ERROR the argument '--\(no-\)daemon' cannot be used with '--no-daemon' (re)
55

6-
Usage: turbo(\.exe)? run --\[no-\]daemon (re)
6+
Usage: turbo(\.exe)? run --\(no-\)daemon (re)
77

88
For more information, try '--help'.
99

turborepo-tests/integration/tests/no-args.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Make sure exit code is 2 when no args are passed
7070
Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html, .mermaid, .dot). Outputs dot graph to stdout when if no filename is provided
7171
--no-cache
7272
Avoid saving task results to the cache. Useful for development/watch tasks
73-
--[no-]daemon
73+
--(no-)daemon
7474
Force turbo to either use or not use the local daemon. If unset turbo will use the default detection logic
7575
--profile <PROFILE>
7676
File to write turbo's performance profile output into. You can load the file up in chrome://tracing to see which parts of your build were slow

turborepo-tests/integration/tests/turbo-help.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Test help flag
7070
Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html, .mermaid, .dot). Outputs dot graph to stdout when if no filename is provided
7171
--no-cache
7272
Avoid saving task results to the cache. Useful for development/watch tasks
73-
--[no-]daemon
73+
--(no-)daemon
7474
Force turbo to either use or not use the local daemon. If unset turbo will use the default detection logic
7575
--profile <PROFILE>
7676
File to write turbo's performance profile output into. You can load the file up in chrome://tracing to see which parts of your build were slow
@@ -215,7 +215,7 @@ Test help flag
215215
--no-cache
216216
Avoid saving task results to the cache. Useful for development/watch tasks
217217

218-
--[no-]daemon
218+
--(no-)daemon
219219
Force turbo to either use or not use the local daemon. If unset turbo will use the default detection logic
220220

221221
--profile <PROFILE>

0 commit comments

Comments
 (0)