From 972e22060e4a0a8be9f99f0ef50a95b23350dfb1 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 17 Feb 2026 12:52:28 +0000 Subject: fix: show help menu when ngit is run without arguments Previously, running ngit without any command would show an error message. Now it displays the help menu, which is more user-friendly and follows standard CLI tool conventions. --- src/bin/ngit/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bin') diff --git a/src/bin/ngit/main.rs b/src/bin/ngit/main.rs index 5458251..c88238a 100644 --- a/src/bin/ngit/main.rs +++ b/src/bin/ngit/main.rs @@ -67,9 +67,9 @@ async fn main() { } => sub_commands::apply::launch(id, *stdout, *offline).await, } } else { - // Handle the case where no command is provided - eprintln!("Error: A command must be provided. Use '--help' for more information."); - std::process::exit(1); + // Show help when no command is provided + Cli::parse_from(["ngit", "--help"]); + std::process::exit(0); }; if let Err(err) = result { -- cgit v1.2.3