fix: remove unused config parameter in mode functions

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-16 12:11:31 -03:00
parent 3f13e490b3
commit 5c66ac3d8a
9 changed files with 40 additions and 84 deletions

View File

@@ -21,7 +21,6 @@ pub mod db;
pub mod plugins;
pub mod meta_plugin;
pub mod common;
//pub mod item;
extern crate term;
extern crate serde_json;
@@ -29,7 +28,7 @@ extern crate serde_yaml;
extern crate serde;
use args::{Args, NumberOrString};
use config::{Config, Settings};
use config::Settings;
/**
* Main function to handle command-line arguments and execute the appropriate mode.
@@ -138,7 +137,7 @@ fn main() -> Result<(), Error> {
}
// Validate server password usage
if settings.server_password.is_some() && mode != KeepModes::Server {
if settings.server_password().is_some() && mode != KeepModes::Server {
cmd.error(
ErrorKind::InvalidValue,
"--server-password can only be used with --server mode"
@@ -160,44 +159,4 @@ fn main() -> Result<(), Error> {
db_path.push("keep-1.db");
debug!("MAIN: Data directory: {:?}", data_path);
debug!("MAIN: DB file: {:?}", db_path);
fs::create_dir_all(data_path.clone()).context("Problem creating data directory")?;
debug!("MAIN: Data directory created or already exists");
let mut conn = db::open(db_path.clone()).context("Problem opening database")?;
debug!("MAIN: DB opened successfully");
match mode {
KeepModes::Save => {
crate::modes::save::mode_save(&mut cmd, &settings, &config, ids, tags, &mut conn, data_path)?
}
KeepModes::Get => {
crate::modes::get::mode_get(&mut cmd, &settings, &config, ids, tags, &mut conn, data_path)?
}
KeepModes::Diff => {
crate::modes::diff::mode_diff(&mut cmd, &settings, &config, ids, tags, &mut conn, data_path)?
}
KeepModes::List => {
crate::modes::list::mode_list(&mut cmd, &settings, &config, ids, tags, &mut conn, data_path)?
}
KeepModes::Update => {
crate::modes::update::mode_update(&mut cmd, &settings, &config, ids, tags, &mut conn, data_path)?
}
KeepModes::Info => {
crate::modes::info::mode_info(&mut cmd, &settings, &config, ids, tags, &mut conn, data_path)?
}
KeepModes::Delete => {
crate::modes::delete::mode_delete(&mut cmd, &settings, &config, ids, tags, &mut conn, data_path)?
}
KeepModes::Status => {
crate::modes::status::mode_status(&mut cmd, &settings, &config, data_path, db_path)?
}
KeepModes::Server => {
crate::modes::server::mode_server(&mut cmd, &settings, &config, &mut conn, data_path)?
}
KeepModes::Unknown => todo!(),
}
Ok(())
}
debug!("MAIN: DB file: {:?}", db_path);