aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/cli.lux
blob: dc64dee6eee71ce66a17c5d549250700b1b482fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
(.module:
  [lux (#- Name)
   [control
    ["<>" parser
     ["." cli (#+ Parser)]]]]
  [//
   [upload (#+ User Password)]
   ["/" profile (#+ Name)]])

(type: #export Compilation
  #Build
  #Test)

(def: compilation
  (Parser Compilation)
  (<>.or (cli.this "build")
         (cli.this "test")))

(type: #export Operation
  #POM
  #Dependencies
  #Install
  (#Deploy Text User Password)
  (#Compilation Compilation)
  (#Auto Compilation))

(type: #export Command
  [Name Operation])

(def: operation
  (Parser Operation)
  ($_ <>.or
      (cli.this "pom")
      (cli.this "deps")
      (cli.this "install")
      (<>.after (cli.this "deploy")
                ($_ <>.and
                    cli.any
                    cli.any
                    cli.any))
      ..compilation
      (<>.after (cli.this "auto")
                ..compilation)
      ))

(def: #export command
  (Parser Command)
  ($_ <>.either
      (<>.after (cli.this "with")
                ($_ <>.and
                    cli.any
                    ..operation))
      (:: <>.monad map (|>> [/.default])
          ..operation)
      ))