fix argument parsing

caused by updating clap
This commit is contained in:
Dr. Matthias Ratajczak
2023-01-05 16:04:03 +01:00
parent a7d0edd3f4
commit a2e1df017f
+4 -5
View File
@@ -2,8 +2,8 @@ use clap::{Arg, Command};
use crate::action::*; use crate::action::*;
fn get_arg_parser() -> Command<'static> { fn get_arg_parser() -> Command {
let result = Command::new("pacdef") Command::new("pacdef")
.about("declarative package manager for Arch Linux") .about("declarative package manager for Arch Linux")
.version("1.0.0-alpha") .version("1.0.0-alpha")
.subcommand_required(true) .subcommand_required(true)
@@ -13,7 +13,7 @@ fn get_arg_parser() -> Command<'static> {
Command::new(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").multiple_values(true)), .arg(Arg::new("group").num_args(0..)),
) )
.subcommand(Command::new(GROUPS).about("show names of imported groups")) .subcommand(Command::new(GROUPS).about("show names of imported groups"))
.subcommand(Command::new(SYNC).about("install packages from all imported groups")) .subcommand(Command::new(SYNC).about("install packages from all imported groups"))
@@ -21,8 +21,7 @@ fn get_arg_parser() -> Command<'static> {
Command::new(UNMANAGED) Command::new(UNMANAGED)
.about("show explicitly installed packages not managed by pacdef"), .about("show explicitly installed packages not managed by pacdef"),
) )
.subcommand(Command::new(VERSION).about("show version info")); .subcommand(Command::new(VERSION).about("show version info"))
result
} }
pub fn get_args() -> clap::ArgMatches { pub fn get_args() -> clap::ArgMatches {