checks for a minimum number of arguments (#1452)

This commit is contained in:
James Hodgkinson 2023-03-13 18:57:00 +10:00 committed by GitHub
parent 73821d0a6b
commit d26bef17b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,6 +36,7 @@ pub struct CommonOpt {
#[derive(Debug, Args)]
pub struct GroupNamedMembers {
name: String,
#[clap(required=true,min_values=1)]
members: Vec<String>,
#[clap(flatten)]
copt: CommonOpt,
@ -717,7 +718,7 @@ pub enum PwBadlistOpt {
Upload {
#[clap(flatten)]
copt: CommonOpt,
#[clap(parse(from_os_str))]
#[clap(parse(from_os_str),required=true,min_values=1)]
paths: Vec<PathBuf>,
/// Perform a dry run and display the list that would have been uploaded instead.
#[clap(short = 'n', long)]
@ -729,7 +730,7 @@ pub enum PwBadlistOpt {
Remove {
#[clap(flatten)]
copt: CommonOpt,
#[clap(parse(from_os_str))]
#[clap(parse(from_os_str), required=true, min_values=1)]
paths: Vec<PathBuf>,
}
}