cargo: Update clap to the latest version
Update to latest clap version.
This commit is contained in:
parent
5339ffa6c0
commit
e9982da560
4 changed files with 103 additions and 131 deletions
12
src/main.rs
12
src/main.rs
|
@ -1,5 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use clap::{crate_authors, crate_version, AppSettings, Parser};
|
||||
use clap::{ArgAction, Parser};
|
||||
|
||||
mod posix;
|
||||
mod sysv;
|
||||
|
@ -34,15 +34,13 @@ enum SysvCommand {
|
|||
|
||||
#[derive(Debug, Parser)]
|
||||
#[clap(
|
||||
version = crate_version!(),
|
||||
author = crate_authors!(", "),
|
||||
setting = AppSettings::SubcommandRequiredElseHelp,
|
||||
global_setting = AppSettings::PropagateVersion,
|
||||
global_setting = AppSettings::InferSubcommands,
|
||||
arg_required_else_help = true,
|
||||
infer_subcommands = true,
|
||||
subcommand_required = true
|
||||
)]
|
||||
struct Opts {
|
||||
/// Produce verbose output, multiple -v options increase the verbosity (max. 3)
|
||||
#[clap(short, long, global = true, parse(from_occurrences))]
|
||||
#[clap(short, long, global = true, action = ArgAction::Count)]
|
||||
verbose: u32,
|
||||
/// Backend to be used
|
||||
#[clap(subcommand)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue