blob: a2f8a4450b85171ff4e8ddcd25724e71bc431b52 (
about) (
plain) (
blame)
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
|
#!/usr/bin/env racket
#lang racket
(define pastebin-verbose? (make-parameter #false))
(define pastebin-title (make-parameter ""))
(define slide-verbose? (make-parameter #false))
(define subcommand
(command-line
#:program "website-cli"
#:args (subcommand . subcommand-options)
(match subcommand
["pastebin"
(command-line
#:program "website-cli pastebin"
#:argv subcommand-options
#:multi
[("-v" "--verbose") "dunno" (pastebin-verbose? #true)]
[("-t" "--title") title "The title of the pastebin, will be slugified for creating the filename." (pastebin-title title)])]
["slide"
(command-line
#:program "website-cli slide"
#:argv subcommand-options
#:usage-help
"woeifj ijfe"
#:multi
[("-v" "--verbose") "Turn on verbose mode" (slide-verbose? #false)]
#:help-labels
"oefijeifjeijfiejfijeij ijij"
#:ps "ps")]
[_
(printf "Invalid subcommand: ~a\n" subcommand)
(exit 1)])
subcommand))
(define out
(match subcommand
["pastebin"
(system "./pastebin/new.sh")]
["slide"
(system "./slides/new.sh")]))
(exit (if out 0 1))
|