summaryrefslogtreecommitdiff
path: root/lib/std/optparse.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-10-10 17:19:27 -0700
committerOri Bernstein <ori@eigenstate.org>2015-10-10 17:19:27 -0700
commit776a9e4ed35369c9c8553e3035daa026e00495e9 (patch)
tree99beac4de9952263367f3a3511838b1beea8d356 /lib/std/optparse.myr
parent954728ed5cc60e638cd858d232c5851f72ad7343 (diff)
downloadmc-776a9e4ed35369c9c8553e3035daa026e00495e9.tar.gz
Some API tweaks to make things match the docs.
Diffstat (limited to 'lib/std/optparse.myr')
-rw-r--r--lib/std/optparse.myr4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/std/optparse.myr b/lib/std/optparse.myr
index ae65b77..d3c72ee 100644
--- a/lib/std/optparse.myr
+++ b/lib/std/optparse.myr
@@ -30,6 +30,7 @@ pkg std =
type optparsed = struct
opts : (char, byte[:])[:]
args : byte[:][:]
+ prog : byte[:]
;;
const optparse : (optargs : byte[:][:], def : optdef# -> optparsed)
@@ -58,7 +59,8 @@ const optparse = {args, def
parsed = [
.opts=[][:],
- .args=[][:]
+ .args=[][:],
+ .prog=args[0]
]
optinit(&ctx, args, def)
while !optdone(&ctx)