Skip to content

Commit

Permalink
fix: use ./.mirrord/mirrord.json instead of mirrord.json as default m…
Browse files Browse the repository at this point in the history
…issing value for -f
  • Loading branch information
waveywaves committed Jan 28, 2025
1 parent 641f525 commit d9e98bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion changelog.d/1706.fixed.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
make `-f` flag accept optional argument, defaulting to "./mirrord.json" when no argument is provided
make `-f` flag accept optional argument, defaulting to "./.mirrord/mirrord.json" when no argument is provided
16 changes: 8 additions & 8 deletions mirrord/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PathBuf>,

/// Kube context to use from Kubeconfig
Expand Down Expand Up @@ -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<PathBuf>,

/// Kube context to use from Kubeconfig
Expand Down Expand Up @@ -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<PathBuf>,
},
/// Operator session management commands.
Expand Down Expand Up @@ -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<PathBuf>,
},
}
Expand Down Expand Up @@ -897,8 +897,8 @@ pub(super) struct VpnArgs {
pub namespace: Option<String>,

/// 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<PathBuf>,

#[cfg(target_os = "macos")]
Expand Down

0 comments on commit d9e98bc

Please sign in to comment.