/
main.go
48 lines (39 loc) · 800 Bytes
/
main.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
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"fmt"
"github.com/urfave/cli"
"os"
)
const (
version = "0.0.6"
)
func defCommands(app *cli.App) {
app.Commands = []cli.Command{
*newTestCommand(),
*newValidateCommand(),
}
}
func defGlobalFlags(app *cli.App) {}
func newCliApp() *cli.App {
app := cli.NewApp()
app.Name = "crash"
app.Version = version
app.Usage = "Run functional and performance tests, asserting and reporting on results.\n" +
" For more detailed help, run: " + app.Name + " help <command>"
app.Author = "Troy Kinsella"
defCommands(app)
defGlobalFlags(app)
return app
}
func main() {
cli.VersionFlag = cli.BoolFlag{
Name: "V, version",
Usage: "print the version",
}
app := newCliApp()
err := app.Run(os.Args)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}