diff --git a/src/main.rs b/src/main.rs index 1ad854b..bdad4ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -347,7 +347,7 @@ fn mode_save(cmd: &mut Command, args: Args, ids: &mut Vec, tags: &mut Vec, tags: &mut Vec, tags: &mut Vec, conn: &mut Connection, data_path: PathBuf) -> Result<()> { if ids.is_empty() && tags.is_empty() { - cmd.error(ErrorKind::InvalidValue, "No ID or tags given, you must supply one ID or atleast one tag when using --get").exit(); + cmd.error(ErrorKind::InvalidValue, "No ID or tags given, you must supply exactly one ID or atleast one tag when using --get").exit(); } else if ! ids.is_empty() && ! tags.is_empty() { - cmd.error(ErrorKind::InvalidValue, "Both ID and tags given, you must supply one ID or atleast one tag when using --get").exit(); + cmd.error(ErrorKind::InvalidValue, "Both ID and tags given, you must supply exactly one ID or atleast one tag when using --get").exit(); } else if ids.len() > 1 { - cmd.error(ErrorKind::InvalidValue, "More than one ID given, you must supply one ID or atleast one tag when using --get").exit(); + cmd.error(ErrorKind::InvalidValue, "More than one ID given, you must supply exactly one ID or atleast one tag when using --get").exit(); } let mut meta: HashMap = HashMap::new(); @@ -547,6 +547,8 @@ fn mode_list(cmd: &mut Command, args: Args, ids: &mut Vec, tags: &Vec, tags: &mut Vec, conn: &mut Connection) -> Result<()> { if ids.is_empty() { cmd.error(ErrorKind::InvalidValue, "No ID given, you must supply one ID when using --update").exit(); + } else if ids.len() > 1 { + cmd.error(ErrorKind::InvalidValue, "More than one ID given, you must supply exactly one ID or atleast one tag when using --update").exit(); } let item_id = ids.iter().next().expect("Unable to determine item id");