diff --git a/crates/turborepo-lib/src/cli.rs b/crates/turborepo-lib/src/cli.rs index bb369612b0ef3..43364c3f38202 100644 --- a/crates/turborepo-lib/src/cli.rs +++ b/crates/turborepo-lib/src/cli.rs @@ -265,7 +265,7 @@ pub enum Command { target: LinkTarget, }, /// Generate a new app / package - G { + Generate { #[clap(long, default_value_t = String::from("latest"), hide = true)] tag: String, #[clap(subcommand)] @@ -309,7 +309,7 @@ pub enum Command { } #[derive(Parser, Clone, Debug, Default, Serialize, PartialEq)] -pub struct GenerateArgs { +pub struct GenerateCustomArgs { /// The name of the generator to run pub generator_name: Option, /// Generator configuration file @@ -364,8 +364,8 @@ pub enum GenerateCommand { #[clap(name = "add", aliases = &["a"])] Add(GenerateAddArgs), /// Run custom generators - #[clap(name = "generate", aliases = &["g", "gen"])] - Gen(GenerateArgs), + #[clap(name = "run", aliases = &["r"])] + Custom(GenerateCustomArgs), } #[derive(Parser, Clone, Debug, Default, Serialize, PartialEq)] @@ -635,7 +635,7 @@ pub async fn run( Ok(Payload::Rust(Ok(0))) } - Command::G { command, tag } => { + Command::Generate { command, tag } => { generate::run(command, tag)?; Ok(Payload::Rust(Ok(0))) } diff --git a/crates/turborepo-lib/src/commands/generate.rs b/crates/turborepo-lib/src/commands/generate.rs index 4c3dad89dce67..bce5a9e69d7eb 100644 --- a/crates/turborepo-lib/src/commands/generate.rs +++ b/crates/turborepo-lib/src/commands/generate.rs @@ -50,7 +50,7 @@ pub fn run(command: &GenerateCommand, tag: &String) -> Result<()> { let raw_args = serde_json::to_string(args)?; call_turbo_gen("add", tag, &raw_args)?; } - GenerateCommand::Gen(args) => { + GenerateCommand::Custom(args) => { let raw_args = serde_json::to_string(args)?; call_turbo_gen("generate", tag, &raw_args)?; } diff --git a/turborepo-tests/integration/tests/no_args.t b/turborepo-tests/integration/tests/no_args.t index f4f5e628bd5bf..752a6ee9d3ec7 100644 --- a/turborepo-tests/integration/tests/no_args.t +++ b/turborepo-tests/integration/tests/no_args.t @@ -12,6 +12,7 @@ Make sure exit code is 2 when no args are passed completion Generate the autocompletion script for the specified shell daemon Runs the Turborepo background daemon link Link your local directory to a Vercel organization and enable remote caching + generate Generate a new app / package login Login to your Vercel account logout Logout to your Vercel account prune Prepare a subset of your monorepo diff --git a/turborepo-tests/integration/tests/turbo_help.t b/turborepo-tests/integration/tests/turbo_help.t index 8c448c355fa73..2d20f57e34370 100644 --- a/turborepo-tests/integration/tests/turbo_help.t +++ b/turborepo-tests/integration/tests/turbo_help.t @@ -12,6 +12,7 @@ Test help flag completion Generate the autocompletion script for the specified shell daemon Runs the Turborepo background daemon link Link your local directory to a Vercel organization and enable remote caching + generate Generate a new app / package login Login to your Vercel account logout Logout to your Vercel account prune Prepare a subset of your monorepo @@ -78,6 +79,7 @@ Test help flag completion Generate the autocompletion script for the specified shell daemon Runs the Turborepo background daemon link Link your local directory to a Vercel organization and enable remote caching + generate Generate a new app / package login Login to your Vercel account logout Logout to your Vercel account prune Prepare a subset of your monorepo