diff --git a/src/command.rs b/src/command.rs index 99a20ee..c485dac 100644 --- a/src/command.rs +++ b/src/command.rs @@ -7,13 +7,14 @@ use clap::Subcommand; use auth::Auth; use deployments::Deployments; +#[allow(clippy::large_enum_variant)] #[derive(Subcommand, Debug)] pub enum Command { #[command(subcommand)] - #[command(about = "Manage auth credentials for the Slot CLI.")] + #[command(about = "Manage auth credentials for the Slot CLI.", aliases = ["a"])] Auth(Auth), #[command(subcommand)] - #[command(about = "Manage Slot deployments.")] + #[command(about = "Manage Slot deployments.", aliases = ["d"])] Deployments(Deployments), } diff --git a/src/command/deployments/create.rs b/src/command/deployments/create.rs index 653ae82..99236b9 100644 --- a/src/command/deployments/create.rs +++ b/src/command/deployments/create.rs @@ -50,7 +50,7 @@ impl CreateArgs { let service = match &self.create_commands { ServiceCommands::Katana(config) => ServiceInput { type_: DeploymentService::katana, - version: None, + version: config.version.clone(), config: Some(ServiceConfigInput { katana: Some(KatanaConfigInput { block_time: config.block_time, @@ -71,7 +71,7 @@ impl CreateArgs { }, ServiceCommands::Torii(config) => ServiceInput { type_: DeploymentService::torii, - version: None, + version: config.version.clone(), config: Some(ServiceConfigInput { katana: None, torii: Some(ToriiConfigInput { diff --git a/src/command/deployments/mod.rs b/src/command/deployments/mod.rs index 35adce0..b38fbd1 100644 --- a/src/command/deployments/mod.rs +++ b/src/command/deployments/mod.rs @@ -24,7 +24,7 @@ pub enum Deployments { Update(UpdateArgs), #[command(about = "Describe a deployment's configuration.")] Describe(DescribeArgs), - #[command(about = "List all deployments.")] + #[command(about = "List all deployments.", aliases = ["ls"])] List(ListArgs), #[command(about = "Fetch logs for a deployment.")] Logs(LogsArgs), diff --git a/src/command/deployments/services/katana.rs b/src/command/deployments/services/katana.rs index c7021e3..242e8d8 100644 --- a/src/command/deployments/services/katana.rs +++ b/src/command/deployments/services/katana.rs @@ -3,6 +3,10 @@ use clap::Args; #[derive(Debug, Args, serde::Serialize)] #[command(next_help_heading = "Katana options")] pub struct KatanaArgs { + #[arg(long, short, value_name = "version")] + #[arg(help = "Service version to use.")] + pub version: Option, + #[arg(long, short, value_name = "block_time")] #[arg(help = "Block time.")] pub block_time: Option, diff --git a/src/command/deployments/services/torii.rs b/src/command/deployments/services/torii.rs index d10fa24..4d2cc54 100644 --- a/src/command/deployments/services/torii.rs +++ b/src/command/deployments/services/torii.rs @@ -4,14 +4,20 @@ use starknet::core::types::FieldElement; #[derive(Clone, Debug, Args, serde::Serialize)] #[command(next_help_heading = "Torii options")] pub struct ToriiArgs { + #[arg(long, short, value_name = "version")] + #[arg(help = "Service version to use.")] + pub version: Option, + #[arg(long)] #[arg(value_name = "rpc")] #[arg(help = "The Starknet RPC endpoint.")] pub rpc: String, + #[arg(long)] #[arg(value_name = "world")] #[arg(help = "World address.")] pub world: FieldElement, + #[arg(short, long)] #[arg(help = "Specify a block to start indexing from.")] pub start_block: i64, diff --git a/src/command/deployments/update.rs b/src/command/deployments/update.rs index c93659a..3235e44 100644 --- a/src/command/deployments/update.rs +++ b/src/command/deployments/update.rs @@ -50,7 +50,7 @@ impl UpdateArgs { let service = match &self.update_commands { ServiceCommands::Katana(config) => ServiceInput { type_: DeploymentService::katana, - version: None, + version: config.version.clone(), config: Some(ServiceConfigInput { katana: Some(KatanaConfigInput { block_time: config.block_time, @@ -71,7 +71,7 @@ impl UpdateArgs { }, ServiceCommands::Torii(config) => ServiceInput { type_: DeploymentService::torii, - version: None, + version: config.version.clone(), config: Some(ServiceConfigInput { katana: None, torii: Some(ToriiConfigInput {