From 9570cd4d5b21d4ba3e18e181097956472a397a76 Mon Sep 17 00:00:00 2001 From: Eric Woolsey Date: Fri, 10 May 2024 13:07:45 -0700 Subject: [PATCH] cargo args --- wasm-deploy/src/cli.rs | 19 +++++++++++++++---- wasm-deploy/src/commands.rs | 11 ++++++++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/wasm-deploy/src/cli.rs b/wasm-deploy/src/cli.rs index ce4bc39..776bf58 100644 --- a/wasm-deploy/src/cli.rs +++ b/wasm-deploy/src/cli.rs @@ -15,10 +15,9 @@ where { #[command(subcommand)] pub command: Commands, - - /// Add additional args to cargo build - #[arg(long, required = false)] - pub cargo_args: Vec, + // /// Add additional args to cargo build + // #[arg(long, required = false)] + // pub cargo_args: Vec, } #[derive(Parser, Clone, Debug)] @@ -46,6 +45,10 @@ where /// Name of the contract #[arg(short, long, use_value_delimiter=true, value_delimiter=',', default_values=get_all::())] contracts: Vec, + + /// Pass arguments to cargo + #[arg(short, long, use_value_delimiter = true, value_delimiter = ' ')] + cargo_args: Vec, }, /// Modify chains @@ -102,6 +105,10 @@ where /// Does not execute transactions, prints txs to console #[arg(short, long, required = false)] dry_run: bool, + + /// Pass arguments to cargo + #[arg(short, long, use_value_delimiter = true, value_delimiter = ' ')] + cargo_args: Vec, }, /// Modify deployment environments @@ -175,6 +182,10 @@ where /// Does not execute transactions, prints txs to console #[arg(short, long, required = false)] dry_run: bool, + + /// Pass arguments to cargo + #[arg(short, long, use_value_delimiter = true, value_delimiter = ' ')] + cargo_args: Vec, }, /// Sets the config of a contract diff --git a/wasm-deploy/src/commands.rs b/wasm-deploy/src/commands.rs index 50de59e..3e30bf7 100644 --- a/wasm-deploy/src/commands.rs +++ b/wasm-deploy/src/commands.rs @@ -64,7 +64,10 @@ where match &cli.command { Commands::Update { features } => update::(settings, features).await?, Commands::Init {} => init(settings).await?, - Commands::Build { contracts } => build(settings, contracts, &cli.cargo_args).await?, + Commands::Build { + contracts, + cargo_args, + } => build(settings, contracts, cargo_args).await?, Commands::Chain { add, delete } => chain(settings, add, delete).await?, Commands::Key { add, delete, show } => key(settings, add, delete, show).await?, Commands::Contract { add, delete } => contract(settings, add, delete).await?, @@ -72,7 +75,8 @@ where contracts, no_build, dry_run, - } => deploy(settings, contracts, *no_build, *dry_run, &cli.cargo_args).await?, + cargo_args, + } => deploy(settings, contracts, *no_build, *dry_run, cargo_args).await?, Commands::Env { add, delete, @@ -93,6 +97,7 @@ where interactive, no_build, dry_run, + cargo_args, } => { migrate( settings, @@ -100,7 +105,7 @@ where *interactive, *no_build, *dry_run, - &cli.cargo_args, + cargo_args, ) .await? }