stash: print --help text if no subcommand is provided

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69646361b7ade52ee73a6aa11be859132a94
This commit is contained in:
raf 2025-08-12 19:11:13 +03:00
commit fcaf5fb14f
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF

View file

@ -5,6 +5,8 @@ use std::{
process,
};
use clap::CommandFactory;
use clap::{Parser, Subcommand};
mod commands;
@ -234,8 +236,11 @@ fn main() {
Some(Command::Watch) => {
run_daemon(&db, cli.max_dedupe_search, cli.max_items);
}
_ => {
log::warn!("No subcommand provided");
None => {
if let Err(e) = Cli::command().print_help() {
eprintln!("Failed to print help: {e}");
}
println!();
}
}
}