diff --git a/yazi-cli/src/args.rs b/yazi-cli/src/args.rs index 1c4475114..bf6cc6b4e 100644 --- a/yazi-cli/src/args.rs +++ b/yazi-cli/src/args.rs @@ -83,6 +83,7 @@ impl CommandPubStatic { } #[derive(clap::Args)] +#[command(arg_required_else_help = true)] pub(super) struct CommandPack { /// Add a package. #[arg(short = 'a', long)] diff --git a/yazi-cli/src/main.rs b/yazi-cli/src/main.rs index 7c1b7ee2b..98ea094b1 100644 --- a/yazi-cli/src/main.rs +++ b/yazi-cli/src/main.rs @@ -6,7 +6,7 @@ use clap::Parser; #[tokio::main] async fn main() -> anyhow::Result<()> { - if std::env::args_os().any(|s| s == "-V" || s == "--version") { + if std::env::args_os().nth(1).is_some_and(|s| s == "-V" || s == "--version") { println!( "Ya {} ({} {})", env!("CARGO_PKG_VERSION"),