This repository has been archived by the owner on Jul 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.go
66 lines (60 loc) · 1.54 KB
/
cli.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
package main
import (
"github.com/urfave/cli"
)
var version = "<devel>"
// runCli : Generates cli configuration for the application
func runCli() (c *cli.App) {
c = cli.NewApp()
c.Name = "evm"
c.Version = version
c.Usage = "Mount and configure an EBS volume within and onto an EC2 instance"
c.EnableBashCompletion = true
c.Flags = []cli.Flag{
cli.StringFlag{
Name: "log-level",
EnvVar: "EVM_LOG_LEVEL",
Usage: "log level (debug,info,warn,fatal,panic)",
Value: "info",
Destination: &logConfig.Level,
},
cli.StringFlag{
Name: "log-format",
EnvVar: "EVM_LOG_FORMAT",
Usage: "log format (json,text)",
Value: "text",
Destination: &logConfig.Format,
},
}
c.Commands = []cli.Command{
{
Name: "mount",
Usage: "mount and configure an EBS volume",
Flags: []cli.Flag{
cli.StringFlag{
Name: "block-device-name, b",
EnvVar: "EVM_BLOCK_DEVICE_NAME",
Usage: "name of the block device to use locally (required)",
},
cli.StringFlag{
Name: "filesystem-type, f",
EnvVar: "EVM_FILESYSTEM_TYPE",
Usage: "type of filesystem to use for the volume",
Value: "ext4",
},
cli.StringFlag{
Name: "mount-point, m",
EnvVar: "EVM_MOUNT_POINT",
Usage: "location to mount the volume (required)",
},
cli.StringFlag{
Name: "volume-name, v",
EnvVar: "EVM_VOLUME_NAME",
Usage: "name of the EBS volume to attach to this instance (required)",
},
},
Action: mount,
},
}
return
}