Add a verbose/quiet pair of flags
This commit is contained in:
parent
782cde2663
commit
8726a1c6bf
4 changed files with 24 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use clap::{command, Parser, Subcommand};
|
||||
use clap_verbosity_flag::{InfoLevel, Verbosity};
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Parser, Serialize)]
|
||||
|
@ -27,6 +28,10 @@ pub(crate) struct Opts {
|
|||
#[command(subcommand)]
|
||||
#[serde(flatten)]
|
||||
pub command: Commands,
|
||||
|
||||
#[command(flatten)]
|
||||
#[serde(skip)]
|
||||
pub verbose: Verbosity<InfoLevel>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Subcommand)]
|
||||
|
@ -78,7 +83,7 @@ pub(crate) enum PeopleCommands {
|
|||
/// Synchronises date of births from a vcard file
|
||||
#[serde(rename = "sync_date_of_births")]
|
||||
SyncDateOfBirths {
|
||||
#[arg(short, long)]
|
||||
#[arg(long)]
|
||||
#[serde(skip_serializing_if = "::std::option::Option::is_none")]
|
||||
vcard: Option<PathBuf>,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue