From 639bd29b2fbde29da6d6ce43c5da1659b8f84ed3 Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Wed, 27 Nov 2024 15:32:25 +0530 Subject: [PATCH] feat: use default config path when no arg for -f is provided --- mirrord/cli/src/config.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mirrord/cli/src/config.rs b/mirrord/cli/src/config.rs index 96548235ad4..8c7f4681231 100644 --- a/mirrord/cli/src/config.rs +++ b/mirrord/cli/src/config.rs @@ -204,7 +204,7 @@ pub(super) struct ExecParams { pub disable_version_check: bool, /// Load config from config file - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json" )] pub config_file: Option, /// Kube context to use from Kubeconfig @@ -426,7 +426,7 @@ pub(super) struct PortForwardArgs { pub disable_version_check: bool, /// Load config from config file - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] pub config_file: Option, /// Kube context to use from Kubeconfig @@ -587,7 +587,7 @@ pub(super) enum OperatorCommand { /// Print operator status Status { /// Specify config file to use - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] config_file: Option, }, /// Operator session management commands. @@ -727,7 +727,7 @@ impl ListTargetArgs { #[derive(Args, Debug)] pub(super) struct ExtensionExecArgs { /// Specify config file to use - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] pub config_file: Option, /// Specify target #[arg(short = 't')] @@ -766,7 +766,7 @@ pub(super) enum DiagnoseCommand { /// Check network connectivity and provide RTT (latency) statistics. Latency { /// Specify config file to use - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] config_file: Option, }, } @@ -895,7 +895,7 @@ pub(super) struct VpnArgs { pub namespace: Option, /// Load config from config file - #[arg(short = 'f', long, value_hint = ValueHint::FilePath)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_value = "./mirrord.json")] pub config_file: Option, #[cfg(target_os = "macos")]