-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
50 lines (45 loc) · 1008 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
49
50
package main
import (
"fmt"
"log"
"os"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = "testnet deployment tool for k8s"
app.Usage = "you can easily deploy blockchain testnet for any cloud vendors"
backendFlag := []cli.Flag{
cli.StringFlag{
Name: "vendor",
Value: "IBM",
},
}
app.Commands = []cli.Command{
{
Name: "backend",
Usage: "select cloud vendors who serves you k8s cluster",
Flags: backendFlag,
Action: func(c *cli.Context) error {
backend := c.String("vendor")
switch backend {
case "IBM":
fmt.Printf("you selected %s backend\n", backend)
case "aws":
fmt.Printf("you selected %s backend\n", backend)
case "gcp":
fmt.Printf("you selected %s backend\n", backend)
case "azure":
fmt.Printf("you selected %s backend\n", backend)
default:
fmt.Printf("ERR! %s is wrong backend\n", backend)
}
return nil
},
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}