这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/integration_tests/no_args.t
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Make sure exit code is 2 when no args are passed
--continue Continue execution even if a task exits with an error or non-zero exit code. The default behavior is to bail
--dry-run [<DRY_RUN>] [possible values: text, json]
--single-package Run turbo in single-package mode
--filter <FILTER> Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter
-F, --filter <FILTER> Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter
--force Ignore the existing cache (to force execution)
--global-deps <GLOBAL_DEPS> Specify glob of global filesystem dependencies to be hashed. Useful for .env and files
--graph [<GRAPH>] Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html). Outputs dot graph to stdout when if no filename is provided
Expand Down
4 changes: 2 additions & 2 deletions cli/integration_tests/turbo_help.t
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Test help flag
--continue Continue execution even if a task exits with an error or non-zero exit code. The default behavior is to bail
--dry-run [<DRY_RUN>] [possible values: text, json]
--single-package Run turbo in single-package mode
--filter <FILTER> Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter
-F, --filter <FILTER> Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter
--force Ignore the existing cache (to force execution)
--global-deps <GLOBAL_DEPS> Specify glob of global filesystem dependencies to be hashed. Useful for .env and files
--graph [<GRAPH>] Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html). Outputs dot graph to stdout when if no filename is provided
Expand Down Expand Up @@ -109,7 +109,7 @@ Test help flag
--continue Continue execution even if a task exits with an error or non-zero exit code. The default behavior is to bail
--dry-run [<DRY_RUN>] [possible values: text, json]
--single-package Run turbo in single-package mode
--filter <FILTER> Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter
-F, --filter <FILTER> Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter
--force Ignore the existing cache (to force execution)
--global-deps <GLOBAL_DEPS> Specify glob of global filesystem dependencies to be hashed. Useful for .env and files
--graph [<GRAPH>] Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html). Outputs dot graph to stdout when if no filename is provided
Expand Down
43 changes: 42 additions & 1 deletion crates/turborepo-lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ pub struct RunArgs {
/// entry points. The syntax mirrors pnpm's syntax, and
/// additional documentation and examples can be found in
/// turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter
#[clap(long, action = ArgAction::Append)]
#[clap(short = 'F', long, action = ArgAction::Append)]
pub filter: Vec<String>,
/// Ignore the existing cache (to force execution)
#[clap(long)]
Expand Down Expand Up @@ -722,6 +722,47 @@ mod test {
}
);

assert_eq!(
Args::try_parse_from([
"turbo", "run", "build", "-F", "water", "-F", "earth", "-F", "fire", "-F", "air"
])
.unwrap(),
Args {
command: Some(Command::Run(Box::new(RunArgs {
tasks: vec!["build".to_string()],
filter: vec![
"water".to_string(),
"earth".to_string(),
"fire".to_string(),
"air".to_string()
],
..get_default_run_args()
}))),
..Args::default()
}
);

assert_eq!(
Args::try_parse_from([
"turbo", "run", "build", "--filter", "water", "-F", "earth", "--filter", "fire",
"-F", "air"
])
.unwrap(),
Args {
command: Some(Command::Run(Box::new(RunArgs {
tasks: vec!["build".to_string()],
filter: vec![
"water".to_string(),
"earth".to_string(),
"fire".to_string(),
"air".to_string()
],
..get_default_run_args()
}))),
..Args::default()
}
);

assert_eq!(
Args::try_parse_from(["turbo", "run", "build", "--force"]).unwrap(),
Args {
Expand Down