summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-03 00:21:14 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-03 00:21:14 -0700
commit075d594d7191ccb985f8f92e7330662bdbe31c02 (patch)
tree172a1cfdb4a8f9d77b8c56363014a041fd78726d /libstd
parent91bab9357cb9bde219ab1763cb8893319e35c390 (diff)
downloadmc-075d594d7191ccb985f8f92e7330662bdbe31c02.tar.gz
Clean up option parsing a bit.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/optparse.myr4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstd/optparse.myr b/libstd/optparse.myr
index 768d666..8b71ce8 100644
--- a/libstd/optparse.myr
+++ b/libstd/optparse.myr
@@ -58,7 +58,7 @@ const optparse = {args, def
parsed.opts = slpush(parsed.opts, optnext(&ctx))
;;
if ctx.args.len < def.minargs
- put("error: expected at least %z args, got %z\n", def.minargs, ctx.args.len)
+ put("error: expected at least %z args, got %i\n", def.minargs, ctx.args.len)
optusage(ctx.optargs[0], ctx.optdef)
exit(1)
;;
@@ -158,7 +158,7 @@ const next = {ctx
}
const optusage = {prog, def
- std.put("usage: %s [-h?]", prog)
+ std.put("usage: %s [-h?] ", prog)
for o in def.opts
std.put("[-%c%s%s] ", o.opt, sep(o.arg), o.arg)
;;