mirror of
https://github.com/NotAShelf/stash.git
synced 2026-04-17 16:19:51 +00:00
stash: print --help text if no subcommand is provided
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a69646361b7ade52ee73a6aa11be859132a94
This commit is contained in:
parent
d9029ef8b7
commit
fcaf5fb14f
1 changed files with 7 additions and 2 deletions
|
|
@ -5,6 +5,8 @@ use std::{
|
||||||
process,
|
process,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use clap::CommandFactory;
|
||||||
|
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
|
|
||||||
mod commands;
|
mod commands;
|
||||||
|
|
@ -234,8 +236,11 @@ fn main() {
|
||||||
Some(Command::Watch) => {
|
Some(Command::Watch) => {
|
||||||
run_daemon(&db, cli.max_dedupe_search, cli.max_items);
|
run_daemon(&db, cli.max_dedupe_search, cli.max_items);
|
||||||
}
|
}
|
||||||
_ => {
|
None => {
|
||||||
log::warn!("No subcommand provided");
|
if let Err(e) = Cli::command().print_help() {
|
||||||
|
eprintln!("Failed to print help: {e}");
|
||||||
|
}
|
||||||
|
println!();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue