remindrs/src/args.rs
finga 0434505b2d Use standard paths for a possible config location
Check several possible standard paths when there is no path to the
configuration file given as argument. To find the configuration file
following paths are used. The local directory `./config.toml`, the
user global configuration directory
`$XDG_CONFIG_HOME/whakarite/config.toml` and the system wide
configuration directory `/etc/whakarite/config.toml`. Note that in the
later two cases the directory which contains the `config.toml`
receives its name from the `$CARGO_BIN_NAME` environment variable at
compile time.
2023-01-25 22:11:32 +01:00

16 lines
375 B
Rust

use clap::Parser;
use std::path::PathBuf;
use tracing::Level;
#[derive(Parser)]
#[command(author, version, about)]
pub struct Args {
/// Use a custom config file
#[arg(short, long, value_name = "FILE")]
pub config: Option<PathBuf>,
/// Set a log level
#[arg(short, long, value_name = "LEVEL", default_value_t = Level::INFO)]
pub log_level: Level,
}