commit c9b97c71efe99f2ad4d332090a1dd2e579321bfc
parent 4b5ade9959ffe01c0717364e22c2c421d0881e9b
Author: Lou Woell <lou.woell@posteo.de>
Date: Fri, 10 Oct 2025 03:30:42 +0200
[harehelper] print usage if no subcommand was given
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/cmd/harehelper/helper.ha b/cmd/harehelper/helper.ha
@@ -90,7 +90,7 @@ export fn main () void = {
os::exit(0);
};
- match (cmd.subcmd) {
+ match :cmd (cmd.subcmd) {
case void => void;
case let c: (str, *getopt::command) =>
switch (c.0) {
@@ -104,8 +104,13 @@ export fn main () void = {
locate(*c.1, &ctx);
case "find-references" =>
find_refs(*c.1, &ctx);
- case => void;
+ case =>
+ fmt::errorfln("Error: {} not a valid subcommand.\n")!;
+ yield :cmd;
};
os::exit(0);
};
+
+ getopt::printusage(os::stderr, "harehelper", help)!;
+ os::exit(1);
};