From 5e3b2507ab7158cc720c700db56833031ae4ded8 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Sun, 19 Jun 2022 12:47:07 -0400 Subject: [PATCH] add arg_enum marker for verbosity arg --- src/cli.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 6be5343..f4d52a2 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,5 +1,5 @@ use std::str::FromStr; -use clap::Parser; +use clap::{Parser, clap_derive::ArgEnum}; use clap_complete::Shell; #[derive(Debug, Clone, Parser)] @@ -14,7 +14,7 @@ pub(crate) struct Args { pub mafiles_path: Option, #[clap(short, long, help = "Specify your encryption passkey.")] pub passkey: Option, - #[clap(short, long, default_value_t=Verbosity::Info, help = "Set the log level.")] + #[clap(short, long, arg_enum, default_value_t=Verbosity::Info, help = "Set the log level.")] pub verbosity: Verbosity, #[clap(subcommand)] @@ -33,7 +33,7 @@ pub(crate) enum Subcommands { Decrypt(ArgsDecrypt), } -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, ArgEnum)] pub(crate) enum Verbosity { Error = 0, Warn = 1,