-
Notifications
You must be signed in to change notification settings - Fork 5
/
commands.go
45 lines (40 loc) · 1.07 KB
/
commands.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
package main
import (
"github.com/otiai10/hotsub/application"
"github.com/otiai10/hotsub/flags"
"github.com/urfave/cli"
)
var commands = []cli.Command{
// run
cli.Command{
Name: "run",
Description: "Run your jobs on cloud with specified input files and any parameters",
Usage: "Run your jobs on cloud with specified input files and any parameters",
Action: func(ctx *cli.Context) error {
if ctx.NumFlags() == 0 {
return ctx.App.Command("help").Run(ctx)
}
return application.Run(ctx)
},
Flags: flags.Index,
},
// init
cli.Command{
Name: "init",
Description: "Initialize CLI environment on which hotsub runs",
Usage: "Initialize CLI environment on which hotsub runs",
Action: func(ctx *cli.Context) error {
return application.Init(ctx)
},
},
// template
cli.Command{
Name: "template",
Description: "Create a template project of hotsub",
Usage: "Create a template project of hotsub",
Action: func(ctx *cli.Context) error {
return application.Template(ctx)
},
Flags: flags.Template,
},
}