Skip to content

Commit

Permalink
remove alias for --daemon/--no-daemon (#9084)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitropoulos committed Aug 30, 2024
1 parent 3f9c869 commit b96d8ad
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
10 changes: 5 additions & 5 deletions crates/turborepo-lib/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,15 +857,15 @@ pub struct RunArgs {

// clap does not have negation flags such as --daemon and --no-daemon
// so we need to use a group to enforce that only one of them is set.
// we set the long name as [no-]daemon with an alias of daemon such
// that we can merge the help text together for both flags
// -----------------------
/// Force turbo to either use or not use the local daemon. If unset
/// Force turbo to use the local daemon. If unset
/// turbo will use the default detection logic.
#[clap(long = "(no-)daemon", alias = "daemon", group = "daemon-group")]
#[clap(long, group = "daemon-group")]
pub daemon: bool,

#[clap(long, group = "daemon-group", hide = true)]
/// Force turbo to not use the local daemon. If unset
/// turbo will use the default detection logic.
#[clap(long, group = "daemon-group")]
pub no_daemon: bool,

/// File to write turbo's performance profile output into.
Expand Down
4 changes: 2 additions & 2 deletions turborepo-tests/integration/tests/conflicting-flags.t
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ ${TURBO} run build --daemon --no-daemon
ERROR the argument '--\(no-\)daemon' cannot be used with '--no-daemon' (re)
ERROR the argument '--daemon' cannot be used with '--no-daemon'

Usage: turbo(\.exe)? run --\(no-\)daemon (re)
Usage: turbo(\.exe)? run --daemon (re)

For more information, try '--help'.

Expand Down
6 changes: 4 additions & 2 deletions turborepo-tests/integration/tests/no-args.t
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ Make sure exit code is 2 when no args are passed
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
--no-cache
Avoid saving task results to the cache. Useful for development/watch tasks
--(no-)daemon
Force turbo to either use or not use the local daemon. If unset turbo will use the default detection logic
--daemon
Force turbo to use the local daemon. If unset turbo will use the default detection logic
--no-daemon
Force turbo to not use the local daemon. If unset turbo will use the default detection logic
--profile <PROFILE>
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
--anon-profile <ANON_PROFILE>
Expand Down
13 changes: 9 additions & 4 deletions turborepo-tests/integration/tests/turbo-help.t
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ Test help flag
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
--no-cache
Avoid saving task results to the cache. Useful for development/watch tasks
--(no-)daemon
Force turbo to either use or not use the local daemon. If unset turbo will use the default detection logic
--daemon
Force turbo to use the local daemon. If unset turbo will use the default detection logic
--no-daemon
Force turbo to not use the local daemon. If unset turbo will use the default detection logic
--profile <PROFILE>
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
--anon-profile <ANON_PROFILE>
Expand Down Expand Up @@ -215,8 +217,11 @@ Test help flag
--no-cache
Avoid saving task results to the cache. Useful for development/watch tasks

--(no-)daemon
Force turbo to either use or not use the local daemon. If unset turbo will use the default detection logic
--daemon
Force turbo to use the local daemon. If unset turbo will use the default detection logic

--no-daemon
Force turbo to not use the local daemon. If unset turbo will use the default detection logic

--profile <PROFILE>
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
Expand Down

0 comments on commit b96d8ad

Please sign in to comment.