Skip to content

Commit

Permalink
fix: add support for --skip-infer (#3022)
Browse files Browse the repository at this point in the history
Somehow we didn't support parsing `--skip-infer`, the shim parser would
allow it, but the actual parser didn't.
  • Loading branch information
chris-olszewski committed Dec 15, 2022
1 parent 9120d3a commit 7bcfd96
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cli/integration_tests/global_turbo/uses_global.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Setup
$ . ${TESTDIR}/../setup.sh

When --skip-infer is used we use the current binary and output no global/local message
$ ${TURBO} --skip-infer --help | head -n 1
The build system that makes ship happen
1 change: 1 addition & 0 deletions cli/integration_tests/no_args.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Make sure exit code is 2 when no args are passed

Options:
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down
6 changes: 6 additions & 0 deletions cli/integration_tests/turbo_help.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Test help flag

Options:
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down Expand Up @@ -84,6 +85,7 @@ Test help flag

Options:
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down Expand Up @@ -132,6 +134,7 @@ Test help flag for link command
Options:
--no-gitignore Do not create or modify .gitignore (default false)
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down Expand Up @@ -159,6 +162,7 @@ Test help flag for unlink command

Options:
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down Expand Up @@ -187,6 +191,7 @@ Test help flag for login command
Options:
--sso-team <SSO_TEAM>
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down Expand Up @@ -214,6 +219,7 @@ Test help flag for logout command

Options:
--version
--skip-infer Skip any attempts to infer which version of Turbo the project is configured to use
--api <API> Override the endpoint for API calls
--color Force color usage in the terminal
--cpu-profile <CPU_PROFILE> Specify a file to save a cpu profile
Expand Down
5 changes: 5 additions & 0 deletions crates/turborepo-lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ pub enum DryRunMode {
pub struct Args {
#[clap(long, global = true)]
pub version: bool,
#[clap(long, global = true)]
#[serde(skip)]
/// Skip any attempts to infer which version of Turbo the project is
/// configured to use
pub skip_infer: bool,
/// Override the endpoint for API calls
#[clap(long, global = true, value_parser)]
pub api: Option<String>,
Expand Down

0 comments on commit 7bcfd96

Please sign in to comment.