aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/cli.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-08-25 16:47:50 -0400
committerEduardo Julian2021-08-25 16:47:50 -0400
commitb216900093c905b3b20dd45c69e577b192e2f7a3 (patch)
tree4d6ac7d257752a8c54ca77dd58df9753ce357ab6 /stdlib/source/program/aedifex/cli.lux
parent36303d6cb2ce3ab9e36d045b9516c997bd461862 (diff)
Updates to the Lua compiler.
Diffstat (limited to 'stdlib/source/program/aedifex/cli.lux')
-rw-r--r--stdlib/source/program/aedifex/cli.lux46
1 files changed, 26 insertions, 20 deletions
diff --git a/stdlib/source/program/aedifex/cli.lux b/stdlib/source/program/aedifex/cli.lux
index 87ad9938a..b51a0d1f1 100644
--- a/stdlib/source/program/aedifex/cli.lux
+++ b/stdlib/source/program/aedifex/cli.lux
@@ -2,7 +2,8 @@
[library
[lux (#- Name)
[abstract
- [equivalence (#+ Equivalence)]]
+ [equivalence (#+ Equivalence)]
+ [monad (#+ do)]]
[control
["<>" parser
["." cli (#+ Parser)]]]
@@ -16,8 +17,9 @@
["/" profile (#+ Name)]])
(type: .public Compilation
- #Build
- #Test)
+ (Variant
+ #Build
+ #Test))
(implementation: any_equivalence
(Equivalence Any)
@@ -36,14 +38,15 @@
(cli.this "test")))
(type: .public Command
- #Version
- #Clean
- #POM
- #Dependencies
- #Install
- (#Deploy Text Identity)
- (#Compilation Compilation)
- (#Auto Compilation))
+ (Variant
+ #Version
+ #Clean
+ #POM
+ #Dependencies
+ #Install
+ (#Deploy Text Identity)
+ (#Compilation Compilation)
+ (#Auto Compilation)))
(def: .public equivalence
(Equivalence Command)
@@ -86,12 +89,15 @@
))
(def: .public command
- (Parser [Name Command])
- ($_ <>.either
- (<>.after (cli.this "with")
- ($_ <>.and
- cli.any
- ..command'))
- (\ <>.monad each (|>> [/.default])
- ..command')
- ))
+ (Parser [(List Name) Command])
+ (<>.rec
+ (function (_ command)
+ ($_ <>.either
+ (<>.after (cli.this "with")
+ (do <>.monad
+ [head cli.any
+ [tail command] command]
+ (in [(#.Item head tail) command])))
+ (\ <>.monad each (|>> [(list /.default)])
+ ..command')
+ ))))