Skip to content

Commit 1b57966

Browse files
authored
chore: make subnet selection arg consistent (#187)
1 parent 3d43277 commit 1b57966

File tree

12 files changed

+24
-24
lines changed

12 files changed

+24
-24
lines changed

crates/icp-cli/src/commands/deploy/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ pub(crate) struct DeployArgs {
2525
#[arg(long, short, default_value = "auto", value_parser = ["auto", "install", "reinstall", "upgrade"])]
2626
pub(crate) mode: String,
2727

28-
/// The subnet id to use for the canisters being deployed.
28+
/// The subnet to use for the canisters being deployed.
2929
#[clap(long)]
30-
pub(crate) subnet_id: Option<Principal>,
30+
pub(crate) subnet: Option<Principal>,
3131

3232
/// One or more controllers for the canisters being deployed. Repeat `--controller` to specify multiple.
3333
#[arg(long)]
@@ -146,7 +146,7 @@ pub(crate) async fn exec(ctx: &Context, args: &DeployArgs) -> Result<(), Command
146146

147147
quiet: false,
148148
cycles: args.cycles,
149-
subnet: args.subnet_id,
149+
subnet: args.subnet,
150150
},
151151
)
152152
.await?;

crates/icp-cli/tests/canister_delete_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn canister_delete() {
4545
.current_dir(&project_dir)
4646
.args([
4747
"deploy",
48-
"--subnet-id",
48+
"--subnet",
4949
common::SUBNET_ID,
5050
"--environment",
5151
"my-environment",

crates/icp-cli/tests/canister_info_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fn canister_status() {
4646
.current_dir(&project_dir)
4747
.args([
4848
"deploy",
49-
"--subnet-id",
49+
"--subnet",
5050
common::SUBNET_ID,
5151
"--environment",
5252
"my-environment",

crates/icp-cli/tests/canister_settings_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn canister_settings_update_controllers() {
5959
.current_dir(&project_dir)
6060
.args([
6161
"deploy",
62-
"--subnet-id",
62+
"--subnet",
6363
common::SUBNET_ID,
6464
"--environment",
6565
"my-environment",
@@ -363,7 +363,7 @@ fn canister_settings_update_log_visibility() {
363363
.current_dir(&project_dir)
364364
.args([
365365
"deploy",
366-
"--subnet-id",
366+
"--subnet",
367367
common::SUBNET_ID,
368368
"--environment",
369369
"my-environment",
@@ -678,7 +678,7 @@ fn canister_settings_update_miscellaneous() {
678678
.current_dir(&project_dir)
679679
.args([
680680
"deploy",
681-
"--subnet-id",
681+
"--subnet",
682682
common::SUBNET_ID,
683683
"--cycles",
684684
&format!("{}", 120 * TRILLION), // 120 TCYCLES because compute allocation is expensive
@@ -801,7 +801,7 @@ fn canister_settings_update_environment_variables() {
801801
.current_dir(&project_dir)
802802
.args([
803803
"deploy",
804-
"--subnet-id",
804+
"--subnet",
805805
common::SUBNET_ID,
806806
"--environment",
807807
"my-environment",

crates/icp-cli/tests/canister_start_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn canister_start() {
4949
.current_dir(&project_dir)
5050
.args([
5151
"deploy",
52-
"--subnet-id",
52+
"--subnet",
5353
common::SUBNET_ID,
5454
"--environment",
5555
"my-environment",

crates/icp-cli/tests/canister_status_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn canister_status() {
4949
.current_dir(&project_dir)
5050
.args([
5151
"deploy",
52-
"--subnet-id",
52+
"--subnet",
5353
common::SUBNET_ID,
5454
"--environment",
5555
"my-environment",

crates/icp-cli/tests/canister_stop_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn canister_stop() {
4848
.current_dir(&project_dir)
4949
.args([
5050
"deploy",
51-
"--subnet-id",
51+
"--subnet",
5252
common::SUBNET_ID,
5353
"--environment",
5454
"my-environment",

crates/icp-cli/tests/deploy_tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn deploy_empty() {
2828
// Deploy project
2929
ctx.icp()
3030
.current_dir(&project_dir)
31-
.args(["deploy", "--subnet-id", common::SUBNET_ID])
31+
.args(["deploy", "--subnet", common::SUBNET_ID])
3232
.assert()
3333
.success();
3434
}
@@ -55,7 +55,7 @@ fn deploy_canister_not_found() {
5555
// Deploy project
5656
ctx.icp()
5757
.current_dir(&project_dir)
58-
.args(["deploy", "my-canister", "--subnet-id", common::SUBNET_ID])
58+
.args(["deploy", "my-canister", "--subnet", common::SUBNET_ID])
5959
.assert()
6060
.failure()
6161
.stderr(eq("Error: project does not contain a canister named 'my-canister'").trim());
@@ -101,7 +101,7 @@ async fn deploy() {
101101
.current_dir(&project_dir)
102102
.args([
103103
"deploy",
104-
"--subnet-id",
104+
"--subnet",
105105
common::SUBNET_ID,
106106
"--environment",
107107
"my-environment",
@@ -166,7 +166,7 @@ async fn deploy_twice_should_succeed() {
166166
.current_dir(&project_dir)
167167
.args([
168168
"deploy",
169-
"--subnet-id",
169+
"--subnet",
170170
common::SUBNET_ID,
171171
"--environment",
172172
"my-environment",
@@ -179,7 +179,7 @@ async fn deploy_twice_should_succeed() {
179179
.current_dir(&project_dir)
180180
.args([
181181
"deploy",
182-
"--subnet-id",
182+
"--subnet",
183183
common::SUBNET_ID,
184184
"--environment",
185185
"my-environment",

crates/icp-cli/tests/network_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ fn deploy_to_other_projects_network() {
181181
.current_dir(&projb)
182182
.args([
183183
"deploy",
184-
"--subnet-id",
184+
"--subnet",
185185
common::SUBNET_ID,
186186
"--environment",
187187
"environment-1",
@@ -194,7 +194,7 @@ fn deploy_to_other_projects_network() {
194194
.current_dir(&projb)
195195
.args([
196196
"deploy",
197-
"--subnet-id",
197+
"--subnet",
198198
common::SUBNET_ID,
199199
"--environment",
200200
"environment-1",

crates/icp-cli/tests/project_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ fn glob_path() {
189189
// // Invoke build
190190
// ctx.icp()
191191
// .current_dir(project_dir)
192-
// .args(["deploy", "--subnet-id", common::SUBNET_ID])
192+
// .args(["deploy", "--subnet", common::SUBNET_ID])
193193
// .assert()
194194
// .failure()
195195
// .stderr(eq("Error: cannot redefine the 'ic' network; the network path 'networks/ic' is invalid").trim());

0 commit comments

Comments
 (0)