-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpreview.go
36 lines (30 loc) · 823 Bytes
/
preview.go
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
package main
import (
"github.com/docopt/docopt.go"
"github.com/ngerakines/preview/cli"
)
func main() {
usage := `Preview
Usage: preview [--help --version --config=<file>]
preview daemon [--help --version --config <file>]
preview render [--verbose... --verify] <host> <file>...
Options:
--help Show this screen.
--version Show version.
--verbose Verbose
--verify Verify that a generate preview request completes
--config=<file> The configuration file to use.`
arguments, _ := docopt.Parse(usage, nil, true, "0.1.1", false)
var command cli.PreviewCliCommand
switch cli.GetCommand(arguments) {
case "render":
{
command = cli.NewRenderCommand(arguments)
}
case "daemon":
{
command = cli.NewDaemonCommand(arguments)
}
}
command.Execute()
}