Revert "add error NoGroupFilesInArguments"

This partially reverts commit a4c900c9a7.

TODO.md is unaffected by this.
This commit is contained in:
steven-omaha
2023-02-22 14:20:09 +01:00
parent a7a001d953
commit 5148cca267
4 changed files with 4 additions and 15 deletions
+1 -2
View File
@@ -45,8 +45,7 @@ fn get_group_cmd() -> Command {
.short('e')
.long("edit")
.help("edit the new group files after creation")
.action(clap::ArgAction::SetTrue)
.num_args(0),
.action(clap::ArgAction::SetTrue),
)
.arg(Arg::new("groups").num_args(1..).required(true))
.visible_alias("n");
+2 -3
View File
@@ -315,9 +315,8 @@ fn get_group_file_paths_matching_args<'a>(
groups: &'a HashSet<Group>,
) -> Result<Vec<&'a Path>> {
let file_names: Vec<_> = arg_match
.get_many::<String>("groups")
.context("getting groups from args")
.map_err(|_| crate::errors::Error::NoGroupFilesInArguments)?
.get_many::<String>("group")
.context("getting groups from args")?
.collect();
let name_group_map: HashMap<&str, &Group> =
-3
View File
@@ -7,15 +7,12 @@ use std::fmt::Display;
pub enum Error {
/// Package search yields no results.
NoPackagesFound,
/// No group files were provided as arguments.
NoGroupFilesInArguments,
}
impl Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::NoPackagesFound => f.write_str("no packages matching query"),
Self::NoGroupFilesInArguments => f.write_str("no group files in arguments"),
}
}
}