commit a30a52d5dfde5c38bd0b39de75a1f33b0f4db96e parent 2b73fccfbd4050e2d91208a0cea30d85f1a87668 Author: Drew DeVault <sir@cmpwn.com> Date: Fri, 12 Mar 2021 12:21:19 -0500 hare build: simplify usage Diffstat:
M | subcmds.ha | | | 11 | +++++++---- |
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/subcmds.ha b/subcmds.ha @@ -47,10 +47,13 @@ fn build(args: []str) void = { assert(goal == goal::EXE); // TODO - let input = if (len(cmd.args) == 0) os::getcwd() else { - assert(len(cmd.args) == 1); // TODO? - cmd.args[0]; - }; + let input = + if (len(cmd.args) == 0) os::getcwd() + else if (len(cmd.args) == 1) cmd.args[0] + else { + getopt::print_usage(os::stderr, args[0], help...); + os::exit(1); + }; let ctx = module::context_init([module::tag { name = os::machine(),