summaryrefslogtreecommitdiff
path: root/lib/std/optparse.myr
diff options
context:
space:
mode:
authorLucas Gabriel Vuotto <lvuotto92@gmail.com>2017-06-13 20:43:37 -0300
committerOri Bernstein <ori@markovcorp.com>2017-06-13 17:14:39 -0700
commitfca3ac4c15e4691e230c2f90f8af71313cddc0a5 (patch)
treec67e7d5e4c6f757a5b4c3661a8359cbee6268efa /lib/std/optparse.myr
parent26da0e6f98ac76f3930ed68649b5fbfe87c06ec4 (diff)
downloadmc-fca3ac4c15e4691e230c2f90f8af71313cddc0a5.tar.gz
Fix std.optparse maxargs check
Signed-off-by: Lucas Gabriel Vuotto <lvuotto92@gmail.com>
Diffstat (limited to 'lib/std/optparse.myr')
-rw-r--r--lib/std/optparse.myr4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/optparse.myr b/lib/std/optparse.myr
index 083c7f5..a2cf06c 100644
--- a/lib/std/optparse.myr
+++ b/lib/std/optparse.myr
@@ -72,8 +72,8 @@ const optparse = {args, def
optusage(ctx.optargs[0], ctx.optdef)
exit(1)
;;
- if def.maxargs > 0 && ctx.args.len < def.minargs
- put("error: expected at most {} args, got {}\n", def.minargs, ctx.args.len)
+ if def.maxargs > 0 && ctx.args.len > def.maxargs
+ put("error: expected at most {} args, got {}\n", def.maxargs, ctx.args.len)
optusage(ctx.optargs[0], ctx.optdef)
exit(1)
;;