-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.go
75 lines (69 loc) · 1.65 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package main
import (
"fmt"
"os"
"github.com/codegangsta/cli"
"github.com/heptagon-inc/recorder/command"
)
var GlobalFlags = []cli.Flag{
cli.BoolFlag{
Name: "debug",
Usage: "Set LogLevel Debug.",
},
}
var Commands = []cli.Command{
{
Name: "ebs",
Usage: "Snapshotting for specific instance's volume.",
Action: command.CmdEbs,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "self, s",
Usage: "Snapshotting for own volume.",
},
cli.StringFlag{
Name: "instance-id, i",
Usage: "Set InstanceId. If '--self' option is set, this is ignored.",
},
cli.StringFlag{
Name: "region, r",
Value: "ap-northeast-1",
Usage: "Set Region. If '--self' option is set, this is ignored.",
},
cli.IntFlag{
Name: "lifecycle, l",
Value: 5,
Usage: "Set the number of life cycle for snapshot.",
},
},
},
{
Name: "ami",
Usage: "Creating Image for specific instance",
Action: command.CmdAmi,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "self, s",
Usage: "Creating Image for own.",
},
cli.StringFlag{
Name: "instance-id, i",
Value: "i-xxxxxxx",
Usage: "Set InstanceId. If '--self' option is set, this is ignored.",
},
cli.StringFlag{
Name: "region, r",
Value: "ap-northeast-1",
Usage: "Set Region. If '--self' option is set, this is ignored.",
},
cli.BoolFlag{
Name: "reboot",
Usage: "Reboot instance when create image. (Default-value: false, NOT-Reboot.)",
},
},
},
}
func CommandNotFound(c *cli.Context, command string) {
fmt.Fprintf(os.Stderr, "%s: '%s' is not a %s command. See '%s --help'.", c.App.Name, command, c.App.Name, c.App.Name)
os.Exit(2)
}