diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex/cli.lux | 46 |
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') + )))) |