summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-04 11:04:50 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-04 11:04:50 -0700
commitff0960cb7029fb443abc45b8961b7a1c1263752c (patch)
tree1d0883c5718d61c4441af4bbb21ac2105a3c4ba6
parentd621aba39611ad76a69efff7d7628d56894b0d9d (diff)
downloadmc-ff0960cb7029fb443abc45b8961b7a1c1263752c.tar.gz
Init the parsed option list.
-rw-r--r--libstd/optparse.myr4
-rw-r--r--mbld/main.myr2
2 files changed, 5 insertions, 1 deletions
diff --git a/libstd/optparse.myr b/libstd/optparse.myr
index e9bf96e..a043263 100644
--- a/libstd/optparse.myr
+++ b/libstd/optparse.myr
@@ -53,6 +53,10 @@ const optparse = {args, def
var ctx : optctx
var parsed
+ parsed = [
+ .opts=[][:],
+ .args=[][:]
+ ]
optinit(&ctx, args, def)
while !optdone(&ctx)
parsed.opts = slpush(parsed.opts, optnext(&ctx))
diff --git a/mbld/main.myr b/mbld/main.myr
index b553035..7fbf996 100644
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -28,7 +28,6 @@ const main = {args : byte[:][:]
[.opt='t', .desc="list all available targets"],
[.opt='S', .desc="generate assembly when building"],
[.opt='d', .desc="dump debugging information for mbld"],
-
[.opt='I', .arg="inc", .desc="add 'inc' to your include path"],
[.opt='R', .arg="root", .desc="install into 'root'"],
[.opt='b', .arg="bin", .desc="compile binary named 'bin' from inputs"],
@@ -38,6 +37,7 @@ const main = {args : byte[:][:]
[.opt='M', .arg="mu", .desc="merge uses with 'mu' instead of the default muse"],
][:]
])
+
bld.initopts()
for opt in cmd.opts
match opt