summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-01 23:06:53 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-01 23:06:53 -0700
commit3de024332750a3cb560cf806de7f28bac35d2925 (patch)
treefa107af4adce1418ad469977a9d24c345493216f /libstd
parent2160d782ffa10f48473a36105c342323a0b7f26c (diff)
downloadmc-3de024332750a3cb560cf806de7f28bac35d2925.tar.gz
Clean up optctx init.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/optparse.myr20
1 files changed, 9 insertions, 11 deletions
diff --git a/libstd/optparse.myr b/libstd/optparse.myr
index 697aba5..df8abc5 100644
--- a/libstd/optparse.myr
+++ b/libstd/optparse.myr
@@ -66,17 +66,15 @@ const optparse = {args, def
}
const optinit = {ctx, args, def
- var ctx
-
- ctx.optargs = args
- ctx.optdef = def
-
- ctx.optdone = false
- ctx.finished = false
- ctx.argidx = 0
- ctx.curarg = [][:]
-
- ctx.args = [][:]
+ ctx# = [
+ .optargs = args,
+ .optdef = def,
+ .optdone = false,
+ .finished = false,
+ .argidx = 0,
+ .curarg = [][:],
+ .args = [][:],
+ ]
next(ctx)
-> ctx