From d9e98bcd1708366a20af327e1c44fce938aeb6cb Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Tue, 28 Jan 2025 16:25:48 +0530 Subject: [PATCH] fix: use ./.mirrord/mirrord.json instead of mirrord.json as default missing value for -f --- changelog.d/1706.fixed.md | 2 +- mirrord/cli/src/config.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/changelog.d/1706.fixed.md b/changelog.d/1706.fixed.md index ba3eb35ac2a..cf8014919e2 100644 --- a/changelog.d/1706.fixed.md +++ b/changelog.d/1706.fixed.md @@ -1 +1 @@ -make `-f` flag accept optional argument, defaulting to "./mirrord.json" when no argument is provided \ No newline at end of file +make `-f` flag accept optional argument, defaulting to "./.mirrord/mirrord.json" when no argument is provided \ No newline at end of file diff --git a/mirrord/cli/src/config.rs b/mirrord/cli/src/config.rs index f34533133dc..0b36c9c796c 100644 --- a/mirrord/cli/src/config.rs +++ b/mirrord/cli/src/config.rs @@ -204,8 +204,8 @@ pub(super) struct ExecParams { pub disable_version_check: bool, /// Load config from config file - /// When using -f flag without a value, defaults to "./mirrord.json" - #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_missing_value = "./mirrord.json", num_args = 0..=1)] + /// When using -f flag without a value, defaults to "./.mirrord/mirrord.json" + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_missing_value = "./.mirrord/mirrord.json", num_args = 0..=1)] pub config_file: Option, /// Kube context to use from Kubeconfig @@ -427,8 +427,8 @@ pub(super) struct PortForwardArgs { pub disable_version_check: bool, /// Load config from config file - /// When using -f flag without a value, defaults to "./mirrord.json" - #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_missing_value = "./mirrord.json", num_args = 0..=1)] + /// When using -f flag without a value, defaults to "./.mirrord/mirrord.json" + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_missing_value = "./.mirrord/mirrord.json", num_args = 0..=1)] pub config_file: Option, /// Kube context to use from Kubeconfig @@ -589,7 +589,7 @@ pub(super) enum OperatorCommand { /// Print operator status Status { /// Specify config file to use - #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_missing_value = "./mirrord.json", num_args = 0..=1)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_missing_value = "./.mirrord/mirrord.json", num_args = 0..=1)] config_file: Option, }, /// Operator session management commands. @@ -768,7 +768,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, default_missing_value = "./mirrord.json", num_args = 0..=1)] + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_missing_value = "./.mirrord/mirrord.json", num_args = 0..=1)] config_file: Option, }, } @@ -897,8 +897,8 @@ pub(super) struct VpnArgs { pub namespace: Option, /// Load config from config file - /// When using -f flag without a value, defaults to "./mirrord.json" - #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_missing_value = "./mirrord.json", num_args = 0..=1)] + /// When using -f flag without a value, defaults to "./.mirrord/mirrord.json" + #[arg(short = 'f', long, value_hint = ValueHint::FilePath, default_missing_value = "./.mirrord/mirrord.json", num_args = 0..=1)] pub config_file: Option, #[cfg(target_os = "macos")]