stash: allow controlling verbosity from the command line

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69641d5d727b1d95f8c9e2b851b3a194315a
This commit is contained in:
raf 2025-08-12 15:37:25 +03:00
commit c23c5af8c1
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 19 additions and 1 deletions

View file

@ -37,6 +37,9 @@ struct Cli {
#[arg(long)]
db_path: Option<PathBuf>,
#[command(flatten)]
verbosity: clap_verbosity_flag::Verbosity,
}
#[derive(Subcommand)]
@ -73,8 +76,11 @@ enum Command {
}
fn main() {
env_logger::init();
let cli = Cli::parse();
env_logger::Builder::new()
.filter_level(cli.verbosity.into())
.init();
let db_path = cli.db_path.unwrap_or_else(|| {
dirs::cache_dir()
.unwrap_or_else(|| PathBuf::from("/tmp"))