stash: add a note about Clap's multicall handling

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4aec7f38ab24a6cd6310630f2169690c6a6a6964
This commit is contained in:
raf 2026-04-12 22:45:02 +03:00
commit 84cf1b46ad
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF

View file

@ -204,6 +204,12 @@ fn main() -> eyre::Result<()> {
color_eyre::install()?;
// Check if we're being called as a multicall binary
//
// NOTE: We cannot use clap's multicall here because it requires the main
// command to have no arguments (only subcommands), but our Cli has global
// arguments like --max-items, --db-path, etc. Instead, we manually detect
// the invocation name and route appropriately. While this is ugly, it's
// seemingly the only option.
let program_name = env::args().next().map(|s| {
PathBuf::from(s)
.file_name()