Merge branch 'RefactorFlags' into development

Signed-off-by: Christian Goll <cgoll@suse.de>
This commit is contained in:
Christian Goll
2023-03-23 11:24:47 +01:00
23 changed files with 940 additions and 184 deletions

View File

@@ -12,8 +12,9 @@ import (
// Holds the variables which are needed in CobraRunE
type variables struct {
netName string
nodeConf node.NodeConf
netName string
nodeConf node.NodeConf
converters []func() error
}
// Returns the newly created command
@@ -28,9 +29,8 @@ func GetCommand() *cobra.Command {
RunE: CobraRunE(&vars),
Args: cobra.MinimumNArgs(1),
}
vars.nodeConf.CreateFlags(baseCmd, []string{"tagdel", "nettagdel", "ipmitagdel"})
vars.converters = vars.nodeConf.CreateFlags(baseCmd, []string{"tagdel", "nettagdel", "ipmitagdel"})
baseCmd.PersistentFlags().StringVar(&vars.netName, "netname", "", "Set network name for network options")
// register the command line completions
if err := baseCmd.RegisterFlagCompletionFunc("container", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
list, _ := container.ListSources()