Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit abc63ad

Browse files
authored
token-cli: don't error when missing default config (#3424)
1 parent 4fadd55 commit abc63ad

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

token/cli/src/main.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,20 +1848,15 @@ fn app<'a, 'b>(
18481848
.about(crate_description!())
18491849
.version(crate_version!())
18501850
.setting(AppSettings::SubcommandRequiredElseHelp)
1851-
.arg({
1852-
let arg = Arg::with_name("config_file")
1851+
.arg(
1852+
Arg::with_name("config_file")
18531853
.short("C")
18541854
.long("config")
18551855
.value_name("PATH")
18561856
.takes_value(true)
18571857
.global(true)
1858-
.help("Configuration file to use");
1859-
if let Some(ref config_file) = *solana_cli_config::CONFIG_FILE {
1860-
arg.default_value(config_file)
1861-
} else {
1862-
arg
1863-
}
1864-
})
1858+
.help("Configuration file to use"),
1859+
)
18651860
.arg(
18661861
Arg::with_name("verbose")
18671862
.short("v")
@@ -2669,6 +2664,8 @@ async fn main() -> Result<(), Error> {
26692664
eprintln!("error: Could not find config file `{}`", config_file);
26702665
exit(1);
26712666
})
2667+
} else if let Some(ref config_file) = *solana_cli_config::CONFIG_FILE {
2668+
solana_cli_config::Config::load(config_file).unwrap_or_default()
26722669
} else {
26732670
solana_cli_config::Config::default()
26742671
};

0 commit comments

Comments
 (0)