diff --git a/cmd/soroban-cli/src/commands/network/container/logs.rs b/cmd/soroban-cli/src/commands/network/container/logs.rs index c21511295..8e9b96437 100644 --- a/cmd/soroban-cli/src/commands/network/container/logs.rs +++ b/cmd/soroban-cli/src/commands/network/container/logs.rs @@ -21,7 +21,7 @@ pub struct Cmd { pub container_args: Args, /// Network container to tail (used in container name generation) - #[arg(required_unless_present = "container_name")] + #[arg(required_unless_present = "name")] pub network: Option, } diff --git a/cmd/soroban-cli/src/commands/network/container/shared.rs b/cmd/soroban-cli/src/commands/network/container/shared.rs index d2d0ccef7..3f2a544bc 100644 --- a/cmd/soroban-cli/src/commands/network/container/shared.rs +++ b/cmd/soroban-cli/src/commands/network/container/shared.rs @@ -34,8 +34,8 @@ pub enum Error { #[derive(Debug, clap::Parser, Clone)] pub struct Args { /// Optional argument to specify the container name - #[arg(short = 'c', long, required_unless_present = "network")] - pub container_name: Option, + #[arg(long, required_unless_present = "network")] + pub name: Option, /// Optional argument to override the default docker host. This is useful when you are using a non-standard docker host path for your Docker-compatible container runtime, e.g. Docker Desktop defaults to $HOME/.docker/run/docker.sock instead of /var/run/docker.sock #[arg(short = 'd', long, help = DOCKER_HOST_HELP, env = "DOCKER_HOST")] @@ -51,7 +51,7 @@ impl Args { } pub(crate) fn get_container_name(&self, network: Option) -> String { - self.container_name.as_ref().map_or_else( + self.name.as_ref().map_or_else( || { format!( "stellar-{}", @@ -67,13 +67,13 @@ impl Args { // (and we generate the container name) or the container name directly. Which is why we need to check if the // container_name is present or not here. pub(crate) fn get_container_name_arg(&self, network: Option) -> String { - self.container_name.as_ref().map_or_else( + self.name.as_ref().map_or_else( || { network .expect("Container name and/or network are required.") .to_string() }, - |container_name| format!("--container-name {container_name}"), + |container_name| format!("--name {container_name}"), ) } } diff --git a/cmd/soroban-cli/src/commands/network/container/stop.rs b/cmd/soroban-cli/src/commands/network/container/stop.rs index 596fcab41..8ddb5d58e 100644 --- a/cmd/soroban-cli/src/commands/network/container/stop.rs +++ b/cmd/soroban-cli/src/commands/network/container/stop.rs @@ -26,7 +26,7 @@ pub struct Cmd { pub container_args: Args, /// Network to stop (used in container name generation) - #[arg(required_unless_present = "container_name")] + #[arg(required_unless_present = "name")] pub network: Option, }