upgrade to clap v4 again

i can't really live with the outdated library
monochrome output is the lesser evil
This commit is contained in:
steven-omaha
2023-01-30 16:55:45 +01:00
parent ff1f374e67
commit 8e84ecfe65
3 changed files with 145 additions and 40 deletions
+8 -9
View File
@@ -5,8 +5,8 @@ use path_absolutize::Absolutize;
use crate::action::*;
fn get_arg_parser() -> Command<'static> {
let result = Command::new("pacdef")
fn get_arg_parser() -> Command {
Command::new("pacdef")
.about("declarative package manager for Arch Linux")
.version("1.0.0-alpha")
.subcommand_required(true)
@@ -16,14 +16,14 @@ fn get_arg_parser() -> Command<'static> {
Command::new(EDIT)
.about("edit one or more existing group files")
.arg_required_else_help(true)
.arg(Arg::new("group").multiple_values(true)),
.arg(Arg::new("group").num_args(1..)),
)
.subcommand(Command::new(GROUPS).about("show names of imported groups"))
.subcommand(
Command::new(IMPORT)
.about("import one or more group files")
.arg_required_else_help(true)
.arg(Arg::new("files").multiple_values(true)),
.arg(Arg::new("files").num_args(1..)),
)
.subcommand(
Command::new(NEW)
@@ -36,13 +36,13 @@ fn get_arg_parser() -> Command<'static> {
.help("edit the new group files after creation")
.action(clap::ArgAction::SetTrue),
)
.arg(Arg::new("groups").multiple_values(true)),
.arg(Arg::new("groups").num_args(1..)),
)
.subcommand(
Command::new(REMOVE)
.about("remove one or more previously imported groups")
.arg_required_else_help(true)
.arg(Arg::new("groups").multiple_values(true)),
.arg(Arg::new("groups").num_args(1..)),
)
.subcommand(Command::new(REVIEW).about("review unmanaged packages"))
.subcommand(
@@ -55,15 +55,14 @@ fn get_arg_parser() -> Command<'static> {
Command::new(SHOW)
.about("show packages under an imported group")
.arg_required_else_help(true)
.arg(Arg::new("group").multiple_values(true)),
.arg(Arg::new("group").num_args(1..)),
)
.subcommand(Command::new(SYNC).about("install packages from all imported groups"))
.subcommand(
Command::new(UNMANAGED)
.about("show explicitly installed packages not managed by pacdef"),
)
.subcommand(Command::new(VERSION).about("show version info"));
result
.subcommand(Command::new(VERSION).about("show version info"))
}
#[must_use]