fix: make id mandatory for delete and optional for get/info

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-29 14:24:19 -03:00
parent 019591ae23
commit 692a403a7e
3 changed files with 11 additions and 5 deletions

View File

@@ -17,7 +17,9 @@ pub fn mode_get(
conn: &mut rusqlite::Connection,
data_path: PathBuf,
) -> Result<()> {
if !ids.is_empty() && !tags.is_empty() {
if ids.is_empty() && tags.is_empty() {
cmd.error(clap::error::ErrorKind::InvalidValue, "No ID or tags given, you must supply exactly one ID or at least one tag when using --get").exit();
} else if !ids.is_empty() && !tags.is_empty() {
cmd.error(clap::error::ErrorKind::InvalidValue, "Both ID and tags given, you must supply exactly one ID or at least one tag when using --get").exit();
} else if ids.len() > 1 {
cmd.error(clap::error::ErrorKind::InvalidValue, "More than one ID given, you must supply exactly one ID or at least one tag when using --get").exit();