feat(cli): make VerbosityLevel serde compatible
cargo devel CI / cargo CI (push) Has been cancelled Details

This commit is contained in:
Christoph J. Scherr 2024-09-06 17:33:15 +02:00
parent 29beabdc29
commit 235a8bfb85
2 changed files with 3 additions and 1 deletions

View File

@ -29,6 +29,7 @@ human-panic = "2.0.0"
indicatif = "0.17.8" indicatif = "0.17.8"
libpt-log = { workspace = true, optional = false } libpt-log = { workspace = true, optional = false }
log = { version = "0.4.21", optional = true } log = { version = "0.4.21", optional = true }
serde = { version = "1.0.209", features = ["derive"] }
shlex = "1.3.0" shlex = "1.3.0"
strum = { version = "0.26.3", features = ["derive"] } strum = { version = "0.26.3", features = ["derive"] }
thiserror.workspace = true thiserror.workspace = true

View File

@ -4,6 +4,7 @@ use clap::Parser;
use libpt_log::Level; use libpt_log::Level;
#[cfg(feature = "log")] #[cfg(feature = "log")]
use log; use log;
use serde::{Deserialize, Serialize};
/// Custom help template for displaying command-line usage information /// Custom help template for displaying command-line usage information
/// ///
@ -95,7 +96,7 @@ Author: {author-with-newline}
/// let level: Level = opts.verbose.level(); /// let level: Level = opts.verbose.level();
/// } /// }
/// ``` /// ```
#[derive(Parser, Clone, PartialEq, Eq, Hash)] #[derive(Parser, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub struct VerbosityLevel { pub struct VerbosityLevel {
/// make the output more verbose /// make the output more verbose
#[arg( #[arg(