-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommands.go
More file actions
172 lines (164 loc) · 4.1 KB
/
Copy pathcommands.go
File metadata and controls
172 lines (164 loc) · 4.1 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
package main
import "github.com/urfave/cli/v2"
var commands = []*cli.Command{
commandBuild,
commandParams,
commandVisual,
commandData,
commandFiles,
commandClean,
}
var commandBuild = &cli.Command{
Name: "build",
Usage: "Build configuration files",
Action: CmdBuild,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "Specify the Config file.",
Value: "config.yaml",
},
&cli.StringFlag{
Name: "name",
Usage: "Name this lab, in place of the topology's own name. Generate the same topology under two names to deploy it twice at once.",
Value: "",
},
&cli.StringFlag{
Name: "profile",
Aliases: []string{"p"},
Usage: "Profile CPU performance in generating internal config model and output to the specified file.",
Value: "",
},
&cli.BoolFlag{
Name: "verbose",
Aliases: []string{"v"},
Usage: "Verbose",
},
},
}
var commandParams = &cli.Command{
Name: "params",
Usage: "List available numbers for config templates",
Action: CmdParams,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "Specify the Config file.",
Value: "config.yaml",
},
&cli.StringFlag{
Name: "name",
Usage: "Name this lab, in place of the topology's own name. Generate the same topology under two names to deploy it twice at once.",
Value: "",
},
&cli.BoolFlag{
Name: "all",
Aliases: []string{"a"},
Usage: "Show all numbers including relative ones.",
},
&cli.BoolFlag{
Name: "verbose",
Aliases: []string{"v"},
Usage: "Verbose",
},
},
}
var commandVisual = &cli.Command{
Name: "visual",
Usage: "Visualize IP address assignment in DOT file",
Action: CmdVisual,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "Specify the Config file.",
Value: "config.yaml",
},
&cli.StringFlag{
Name: "name",
Usage: "Name this lab, in place of the topology's own name. Generate the same topology under two names to deploy it twice at once.",
Value: "",
},
&cli.StringFlag{
Name: "layer",
Aliases: []string{"l"},
Usage: "Specify layer name to visualize. If not given, all information will be visualized.",
Value: "",
},
&cli.BoolFlag{
Name: "verbose",
Aliases: []string{"v"},
Usage: "Verbose",
},
},
}
var commandData = &cli.Command{
Name: "data",
Usage: "Output parameter data in JSON format",
Action: CmdData,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "Specify the Config file.",
Value: "config.yaml",
},
&cli.StringFlag{
Name: "name",
Usage: "Name this lab, in place of the topology's own name. Generate the same topology under two names to deploy it twice at once.",
Value: "",
},
},
}
var commandFiles = &cli.Command{
Name: "files",
Usage: "List files that would be generated by build command",
Action: CmdFiles,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "Specify the Config file.",
Value: "config.yaml",
},
&cli.StringFlag{
Name: "name",
Usage: "Name this lab, in place of the topology's own name. Generate the same topology under two names to deploy it twice at once.",
Value: "",
},
&cli.BoolFlag{
Name: "verbose",
Aliases: []string{"v"},
Usage: "Verbose",
},
},
}
var commandClean = &cli.Command{
Name: "clean",
Usage: "Delete configuration files that would be generated by build command",
Action: CmdClean,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Usage: "Specify the Config file.",
Value: "config.yaml",
},
&cli.StringFlag{
Name: "name",
Usage: "Name this lab, in place of the topology's own name. Generate the same topology under two names to deploy it twice at once.",
Value: "",
},
&cli.BoolFlag{
Name: "verbose",
Aliases: []string{"v"},
Usage: "Verbose",
},
&cli.BoolFlag{
Name: "dry-run",
Usage: "Show what files would be deleted without actually deleting them",
},
},
}