Add --verbose flag

This commit is contained in:
Joscha 2023-01-23 23:03:17 +01:00
parent f9533d8119
commit 2f7234189b
3 changed files with 16 additions and 5 deletions

View file

@ -57,6 +57,10 @@ impl Default for Command {
#[derive(Debug, clap::Parser)]
#[command(version)]
struct Args {
/// Show more detailed log messages.
#[arg(long, short)]
verbose: bool,
/// Path to the config file.
///
/// Relative paths are interpreted relative to the current directory.
@ -114,9 +118,8 @@ fn set_offline(config: &mut Config, args_offline: bool) {
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let (logger, logger_guard, logger_rx) = Logger::init(log::Level::Debug);
let args = Args::parse();
let (logger, logger_guard, logger_rx) = Logger::init(args.verbose);
let dirs = ProjectDirs::from("de", "plugh", "cove").expect("unable to determine directories");
let config_path = args