-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand.go
34 lines (23 loc) · 1.08 KB
/
command.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
package installkubedash
import (
"reflect"
"github.com/doug4j/acdu/pkg/common"
"github.com/spf13/cobra"
)
//ArgNamespace is used to populate command line argments for the Namespace.
var ArgNamespace string
//ArgTimeoutSeconds is used to populate command line argments for the TimeoutSeconds.
var ArgTimeoutSeconds int
//ArgQueryForAllPodsRunningSeconds is used to populate command line argments for the QueryForAllPodsRunningSeconds.
var ArgQueryForAllPodsRunningSeconds int
//ArgInteractive is used to populate command line argments for the Interactive.
var ArgInteractive bool
//FillCobraCommand assigns default parameters for this command to the Cobra command.
func FillCobraCommand(cmd *cobra.Command) {
var cmdLineParm = Parms{}
parmType := reflect.TypeOf(cmdLineParm)
common.AttachStringArg(cmd, parmType, "Namespace", &ArgNamespace)
common.AttachBoolArg(cmd, parmType, "Interactive", &ArgInteractive)
common.AttachIntArg(cmd, parmType, "TimeoutSeconds", &ArgTimeoutSeconds)
common.AttachIntArg(cmd, parmType, "QueryForAllPodsRunningSeconds", &ArgQueryForAllPodsRunningSeconds)
}