mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-08-07 01:33:52 +00:00
feat(config): implement config init/get/set/path commands
This commit is contained in:
parent
2b5a1b28de
commit
d2fa081266
4 changed files with 134 additions and 7 deletions
15
src/main.rs
15
src/main.rs
|
|
@ -40,13 +40,22 @@ fn run() -> Result<(), IdxError> {
|
|||
}
|
||||
Commands::Stocks(stocks) => {
|
||||
let provider = default_provider();
|
||||
if let Err(err) = cli::stocks::handle(stocks, &config, provider.as_ref()) {
|
||||
if let Err(err) = cli::stocks::handle(stocks, &config, provider.as_ref(), cli.offline, cli.no_cache) {
|
||||
emit_error(&err, &config.output);
|
||||
return Err(err);
|
||||
}
|
||||
}
|
||||
Commands::Config(_) | Commands::Cache(_) => {
|
||||
println!("Not implemented yet");
|
||||
Commands::Config(cfg) => {
|
||||
if let Err(err) = cli::config::handle(cfg) {
|
||||
emit_error(&err, &config.output);
|
||||
return Err(err);
|
||||
}
|
||||
}
|
||||
Commands::Cache(cache) => {
|
||||
if let Err(err) = cli::cache::handle(cache) {
|
||||
emit_error(&err, &config.output);
|
||||
return Err(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue