-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
51 lines (44 loc) · 882 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
51
package main
import (
"fmt"
mema "mmctl/cmd"
"github.com/spf13/cobra"
)
func version() *cobra.Command {
v := &cobra.Command{
Use: "version",
Short: "show version",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("v0.3")
},
}
return v
}
func main() {
// cmd.Execute()
// var fwk string
mainCmd := &cobra.Command{
Use: "mmctl",
Short: "Mesos Marathon ctl",
}
get := &cobra.Command{
Use: "get",
Short: "Get Mesos and Marathon information",
}
inspect := &cobra.Command{
Use: "inspect",
Short: "Inspect a appid details information",
}
mainCmd.AddCommand(get)
mainCmd.AddCommand(inspect)
// mema.AppID.Flags().StringVarP(&fwk,"framework","f","","Select a FrameWork show appid")
get.AddCommand(
version(),
mema.AppID,
mema.FrameWork,
mema.Node,
)
if err := mainCmd.Execute(); err != nil {
fmt.Println(err)
}
}