Skip to content

Commit

Permalink
feat: ya pack displays help if no arguments are given (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas committed May 8, 2024
1 parent faa1d9f commit 386dd4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions yazi-cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion yazi-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 386dd4c

Please sign in to comment.