Skip to content

Commit

Permalink
Support updating version
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Nov 2, 2023
1 parent 7c96cdb commit 451526b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}

Expand Down
4 changes: 2 additions & 2 deletions src/command/deployments/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/command/deployments/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 4 additions & 0 deletions src/command/deployments/services/katana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,

#[arg(long, short, value_name = "block_time")]
#[arg(help = "Block time.")]
pub block_time: Option<i64>,
Expand Down
6 changes: 6 additions & 0 deletions src/command/deployments/services/torii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,

#[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,
Expand Down
4 changes: 2 additions & 2 deletions src/command/deployments/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand Down

0 comments on commit 451526b

Please sign in to comment.