feat: ya pack displays help if no arguments are given (#1012)

This commit is contained in:
Mika Vilpas 2024-05-08 09:14:34 +03:00 committed by GitHub
parent faa1d9f37b
commit 386dd4c9c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -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)]

View file

@ -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"),