Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use default config path when no arg for -f is provided #2939

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
14 changes: 7 additions & 7 deletions mirrord/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,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 @@ -421,7 +421,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 @@ -582,7 +582,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 @@ -708,14 +708,14 @@ pub(super) struct ListTargetArgs {
pub namespace: Option<String>,

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

#[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 @@ -754,7 +754,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 @@ -849,7 +849,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
Loading