ref: 67ae2844ebf6a215b8b48351c0c5ab32c7cb4652
parent: 3b5a5cd9b9843d0ba824c756911456d57cf1c1be
author: Ori Bernstein <[email protected]>
date: Fri May 1 19:06:53 EDT 2015
Clean up optctx init.
--- a/libstd/optparse.myr
+++ b/libstd/optparse.myr
@@ -66,17 +66,15 @@
}
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