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.lux69
1 files changed, 41 insertions, 28 deletions
diff --git a/stdlib/source/program/compositor/cli.lux b/stdlib/source/program/compositor/cli.lux
index 0c20257ed..940665680 100644
--- a/stdlib/source/program/compositor/cli.lux
+++ b/stdlib/source/program/compositor/cli.lux
@@ -1,42 +1,55 @@
(.module:
- [lux #*
+ [lux (#- Module Source)
[control
- ["p" parser
+ ["<>" parser
["." cli (#+ Parser)]]]
+ [tool
+ [compiler
+ [meta
+ [archive
+ [descriptor (#+ Module)]]]]]
[world
[file (#+ Path)]]])
-(type: #export Service
- #Compilation
- #Interpretation)
+(type: #export Source Path)
+(type: #export Target Path)
+
+(type: #export Compilation
+ [(List Source) Target Module])
+
+(type: #export Export
+ [(List Source) Target])
-(type: #export Configuration
- {#service Service
- #sources (List Path)
- #target Path
- #module Text})
+(type: #export Service
+ (#Compilation Compilation)
+ (#Interpretation Compilation)
+ (#Export Export))
-(template [<name> <long>]
+(template [<name> <long> <type>]
[(def: <name>
- (Parser Text)
+ (Parser <type>)
(cli.named <long> cli.any))]
- [source "--source"]
- [target "--target"]
- [module "--module"]
+ [source "--source" Source]
+ [target "--target" Target]
+ [module "--module" Module]
)
-
-(def: service
+(def: #export service
(Parser Service)
- ($_ p.or
- (cli.this "build")
- (cli.this "repl")))
-
-(def: #export configuration
- (Parser Configuration)
- ($_ p.and
- ..service
- (p.some ..source)
- ..target
- ..module))
+ ($_ <>.or
+ (<>.after (cli.this "build")
+ ($_ <>.and
+ (<>.some ..source)
+ ..target
+ ..module))
+ (<>.after (cli.this "repl")
+ ($_ <>.and
+ (<>.some ..source)
+ ..target
+ ..module))
+ (<>.after (cli.this "export")
+ ($_ <>.and
+ (<>.some ..source)
+ ..target))
+ ))