commit d1405abc2229d904805366e36b7e1c7b3f53cad0
parent 1eed681548cab75223cd0500b5db32f01ca59a0e
Author: Byron Torres <b@torresjrjr.com>
Date: Thu, 28 Apr 2022 23:00:13 +0100
nl: perform arg check earlier
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/nl.ha b/nl.ha
@@ -57,6 +57,10 @@ export fn utilmain() (void | main::error) = {
const cmd = getopt::parse(os::args, help...);
defer getopt::finish(&cmd);
+ if (len(cmd.args) > 1) {
+ usage(help, void);
+ };
+
static const delim_buf: [2]u8 = [0, 0];
let delim = "\\:";
@@ -201,10 +205,6 @@ export fn utilmain() (void | main::error) = {
};
};
- if (len(cmd.args) > 1) {
- usage(help, void);
- };
-
defer {
if (head_style is regex::regex) {
regex::regex_finish(&(head_style as regex::regex));