1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-30 07:03:02 +00:00

Add default for bindir.

This commit is contained in:
Calvin Rose
2019-05-28 22:12:42 -04:00
parent c6ac53f4be
commit 6c897b1a37
3 changed files with 12 additions and 5 deletions

View File

@@ -4,8 +4,6 @@
(import cook :prefix "")
(import-rules "./project.janet")
(def- argpeg
(peg/compile
'(* "--" '(some (if-not "=" 1)) "=" '(any 1))))
@@ -30,10 +28,15 @@ Keys are:
`))
(def args (tuple/slice process/args 2))
(def todo @[])
(each arg args
(if (string/has-prefix? "--" arg)
(let [[key value] (peg/match argpeg arg)]
(setdyn (keyword key) value))
(do-rule arg)))
(array/push todo arg)))
(import-rules "./project.janet")
(each r todo (do-rule r))
(if (empty? args) (help))