fix completion

This commit is contained in:
steven-omaha
2023-02-24 14:33:51 +01:00
parent e4fe73c7eb
commit 5e82ace871
3 changed files with 45 additions and 28 deletions
+5 -1
View File
@@ -91,7 +91,11 @@ fn get_package_cmd() -> Command {
.visible_alias("se")
.about("search for packages which match a provided string literal or regex")
.arg_required_else_help(true)
.arg(Arg::new("string").required(true));
.arg(
Arg::new("regex")
.required(true)
.help("the regular expression the package must match"),
);
Command::new("package")
.arg_required_else_help(true)
+1 -1
View File
@@ -10,7 +10,7 @@ use crate::grouping::{Group, Package, Section};
pub fn search_packages(args: &ArgMatches, groups: &HashSet<Group>) -> Result<()> {
let search_string = args
.get_one::<String>("string")
.get_one::<String>("regex")
.context("getting search string from arg")?;
let re = Regex::new(search_string)?;