aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/compositor/cli.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/program/compositor/cli.lux')
-rw-r--r--stdlib/source/program/compositor/cli.lux36
1 files changed, 22 insertions, 14 deletions
diff --git a/stdlib/source/program/compositor/cli.lux b/stdlib/source/program/compositor/cli.lux
index e0bcd6e00..03235bbad 100644
--- a/stdlib/source/program/compositor/cli.lux
+++ b/stdlib/source/program/compositor/cli.lux
@@ -1,6 +1,7 @@
(.module:
[lux (#- Module Source)
[control
+ [pipe (#+ case>)]
["<>" parser
["." cli (#+ Parser)]]]
[tool
@@ -31,10 +32,10 @@
(Parser <type>)
(cli.named <long> cli.any))]
- [source "--source" Source]
- [library "--library" Library]
- [target "--target" Target]
- [module "--module" Module]
+ [^source "--source" Source]
+ [^library "--library" Library]
+ [^target "--target" Target]
+ [^module "--module" Module]
)
(def: #export service
@@ -42,18 +43,25 @@
($_ <>.or
(<>.after (cli.this "build")
($_ <>.and
- (<>.some ..source)
- (<>.some ..library)
- ..target
- ..module))
+ (<>.some ..^source)
+ (<>.some ..^library)
+ ..^target
+ ..^module))
(<>.after (cli.this "repl")
($_ <>.and
- (<>.some ..source)
- (<>.some ..library)
- ..target
- ..module))
+ (<>.some ..^source)
+ (<>.some ..^library)
+ ..^target
+ ..^module))
(<>.after (cli.this "export")
($_ <>.and
- (<>.some ..source)
- ..target))
+ (<>.some ..^source)
+ ..^target))
))
+
+(def: #export target
+ (-> Service Target)
+ (|>> (case> (^or (#Compilation [sources libraries target module])
+ (#Interpretation [sources libraries target module])
+ (#Export [sources target]))
+ target)))