Skip to content

Commit

Permalink
Update arg
Browse files Browse the repository at this point in the history
  • Loading branch information
tknickman committed May 11, 2023
1 parent 37d8aaf commit efe8c38
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions crates/turborepo-lib/src/cli.rs
Expand Up @@ -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)]
Expand Down Expand Up @@ -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<String>,
/// Generator configuration file
Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -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)))
}
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/commands/generate.rs
Expand Up @@ -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)?;
}
Expand Down
1 change: 1 addition & 0 deletions turborepo-tests/integration/tests/no_args.t
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions turborepo-tests/integration/tests/turbo_help.t
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit efe8c38

Please sign in to comment.