Skip to content

Commit

Permalink
feat: use default config path when no arg for -f is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
waveywaves committed Jan 27, 2025
1 parent e64a17e commit 474f740
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.d/1706.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add default value './mirrord.json' for the `--config-file` flag.
12 changes: 6 additions & 6 deletions mirrord/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PathBuf>,

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

/// Kube context to use from Kubeconfig
Expand Down Expand Up @@ -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<PathBuf>,
},
/// Operator session management commands.
Expand Down Expand Up @@ -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<PathBuf>,
/// Specify target
#[arg(short = 't')]
Expand Down Expand Up @@ -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<PathBuf>,
},
}
Expand Down Expand Up @@ -895,7 +895,7 @@ pub(super) struct VpnArgs {
pub namespace: Option<String>,

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

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

0 comments on commit 474f740

Please sign in to comment.