diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-17 12:52:28 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-17 15:09:03 +0000 |
| commit | 972e22060e4a0a8be9f99f0ef50a95b23350dfb1 (patch) | |
| tree | 1f566f876ed9e190eacc7e57f7e82ceb5819b602 /src/bin/ngit | |
| parent | 4cbba068d1ddbd14ba41d75def3ae266989aced8 (diff) | |
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.
Diffstat (limited to 'src/bin/ngit')
| -rw-r--r-- | src/bin/ngit/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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() { | |||
| 67 | } => sub_commands::apply::launch(id, *stdout, *offline).await, | 67 | } => sub_commands::apply::launch(id, *stdout, *offline).await, |
| 68 | } | 68 | } |
| 69 | } else { | 69 | } else { |
| 70 | // Handle the case where no command is provided | 70 | // Show help when no command is provided |
| 71 | eprintln!("Error: A command must be provided. Use '--help' for more information."); | 71 | Cli::parse_from(["ngit", "--help"]); |
| 72 | std::process::exit(1); | 72 | std::process::exit(0); |
| 73 | }; | 73 | }; |
| 74 | 74 | ||
| 75 | if let Err(err) = result { | 75 | if let Err(err) = result { |