add aliases for all subcommands

This commit is contained in:
steven-omaha
2023-02-20 13:15:40 +01:00
parent 1a33f4bad9
commit f8f5f9b4d8
+26 -11
View File
@@ -24,14 +24,18 @@ fn get_group_cmd() -> Command {
let edit = Command::new(EDIT) let edit = Command::new(EDIT)
.about("edit one or more existing group files") .about("edit one or more existing group files")
.arg_required_else_help(true) .arg_required_else_help(true)
.arg(Arg::new("group").num_args(1..)); .arg(Arg::new("group").num_args(1..))
.visible_alias("e");
let import = Command::new(IMPORT) let import = Command::new(IMPORT)
.about("import one or more group files") .about("import one or more group files")
.arg_required_else_help(true) .arg_required_else_help(true)
.arg(Arg::new("files").num_args(1..)); .arg(Arg::new("files").num_args(1..))
.visible_alias("i");
let list = Command::new(LIST).about("list names of imported groups"); let list = Command::new(LIST)
.about("list names of imported groups")
.visible_alias("l");
let new = Command::new(NEW) let new = Command::new(NEW)
.about("create new group files") .about("create new group files")
@@ -43,17 +47,20 @@ fn get_group_cmd() -> Command {
.help("edit the new group files after creation") .help("edit the new group files after creation")
.action(clap::ArgAction::SetTrue), .action(clap::ArgAction::SetTrue),
) )
.arg(Arg::new("groups").num_args(1..)); .arg(Arg::new("groups").num_args(1..))
.visible_alias("n");
let remove = Command::new(REMOVE) let remove = Command::new(REMOVE)
.about("remove one or more previously imported groups") .about("remove one or more previously imported groups")
.arg_required_else_help(true) .arg_required_else_help(true)
.arg(Arg::new("groups").num_args(1..)); .arg(Arg::new("groups").num_args(1..))
.visible_alias("r");
let show = Command::new(SHOW) let show = Command::new(SHOW)
.about("show packages under an imported group") .about("show packages under an imported group")
.arg_required_else_help(true) .arg_required_else_help(true)
.arg(Arg::new("group").num_args(1..)); .arg(Arg::new("group").num_args(1..))
.visible_alias("s");
Command::new("group") Command::new("group")
.arg_required_else_help(true) .arg_required_else_help(true)
@@ -64,12 +71,20 @@ fn get_group_cmd() -> Command {
} }
fn get_package_cmd() -> Command { fn get_package_cmd() -> Command {
let sync = Command::new(SYNC).about("install packages from all imported groups"); let sync = Command::new(SYNC)
let clean = Command::new(CLEAN).about("remove unmanaged packages"); .about("install packages from all imported groups")
let unmanaged = .visible_alias("sy");
Command::new(UNMANAGED).about("show explicitly installed packages not managed by pacdef"); let clean = Command::new(CLEAN)
let review = Command::new(REVIEW).about("review unmanaged packages"); .about("remove unmanaged packages")
.visible_alias("c");
let unmanaged = Command::new(UNMANAGED)
.about("show explicitly installed packages not managed by pacdef")
.visible_alias("u");
let review = Command::new(REVIEW)
.about("review unmanaged packages")
.visible_alias("r");
let search = Command::new(SEARCH) let search = Command::new(SEARCH)
.visible_alias("se")
.about("search for packages which match a provided string literal or regex") .about("search for packages which match a provided string literal or regex")
.arg_required_else_help(true) .arg_required_else_help(true)
.arg(Arg::new("string")); .arg(Arg::new("string"));