feat: add --change-key flag to update API key
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -3,6 +3,7 @@ use noentropy::cli::{
|
||||
Args,
|
||||
orchestrator::{handle_organization, handle_undo},
|
||||
};
|
||||
use noentropy::settings::config::change_and_prompt_api_key;
|
||||
use noentropy::settings::{get_or_prompt_config, get_or_prompt_download_folder};
|
||||
|
||||
#[tokio::main]
|
||||
@@ -14,6 +15,15 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
handle_undo(args, download_path).await?;
|
||||
return Ok(());
|
||||
}
|
||||
if args.change_key {
|
||||
let api_key = change_and_prompt_api_key();
|
||||
match api_key {
|
||||
Ok(_key) => println!("Key saved"),
|
||||
Err(e) => {
|
||||
eprintln!("{e}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let config = get_or_prompt_config()?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user