rust: Streamline and cleanup verbosity handling

Create one implementation for the verbose option to be used by all
tools. While at it, add a quiet option to decrease the verbosity.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Steffen Eiden
2024-11-07 11:03:41 +01:00
parent 576a230341
commit 53d803abf3
9 changed files with 125 additions and 123 deletions
+5 -4
View File
@@ -3,18 +3,19 @@
// Copyright IBM Corp. 2023
use clap::{ArgGroup, Args, CommandFactory, Parser, Subcommand, ValueEnum, ValueHint};
use utils::{CertificateOptions, STDOUT};
use utils::{CertificateOptions, DeprecatedVerbosityOptions, STDOUT};
/// Manage secrets for IBM Secure Execution guests.
///
/// Use to create and send add-secret requests, list the added secrets and lock the Secret Store.
#[derive(Parser, Debug)]
pub struct CliOptions {
/// Provide more detailed output.
#[arg(short='v', long, action = clap::ArgAction::Count, short_alias('V'))]
pub verbose: u8,
#[clap(flatten)]
pub verbosity: DeprecatedVerbosityOptions,
/// Print version information and exit.
// Implemented for the help message only. Actual parsing happens in the
// version command.
#[arg(long)]
pub version: bool,