Skip to content

Commit

Permalink
fixed code not compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
ldev committed Nov 13, 2023
1 parent 6460a1b commit c64435d
Showing 1 changed file with 1 addition and 42 deletions.
43 changes: 1 addition & 42 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,47 +43,6 @@ struct Cli {
#[command(subcommand)]
operation: Operation,
}
#[derive(Args)]
struct Verbosity {
///Suppress most output
#[arg(long, global = true, short = 'q')]
quiet: bool,

///More verbose logging
#[arg(long, action=clap::ArgAction::Count, global = true, short = 'v')]
verbose: u8,
}
impl Verbosity {
fn log_level(&self) -> LogLevelNum {
if self.quiet {
return LogLevelNum::Off;
}
if self.verbose == 1 {
return LogLevelNum::Debug;
}
if self.verbose > 1 {
return LogLevelNum::Trace;
}

LogLevelNum::Info
}

fn is_quied(&self) -> bool {
self.quiet
}
}
impl fmt::Display for Verbosity {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.write_str(match self.log_level() {
LogLevelNum::Off => "QUIET",
LogLevelNum::Error => "ERROR",
LogLevelNum::Warn => "WARN",
LogLevelNum::Info => "INFO",
LogLevelNum::Debug => "DEBUG",
LogLevelNum::Trace => "TRACE",
})
}
}

#[derive(Subcommand, Copy, Clone)]
pub enum Operation {
Expand Down Expand Up @@ -113,7 +72,7 @@ impl Operation {
}

#[tokio::main]
async fn main() -> ExitCode {
async fn main() {
let cli = Cli::parse();

stderrlog::new()
Expand Down

0 comments on commit c64435d

Please sign in to comment.