wwctl image completions and arguments
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -10,11 +10,6 @@ import (
|
||||
)
|
||||
|
||||
func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
|
||||
if len(args) > 2 {
|
||||
wwlog.Warn("copy only requires 2 arguments but you provided %d arguments. Hence, they will be ignored.", len(args))
|
||||
}
|
||||
|
||||
cdp := &wwapiv1.ImageCopyParameter{
|
||||
ImageSource: args[0],
|
||||
ImageDestination: args[1],
|
||||
|
||||
@@ -13,7 +13,7 @@ var (
|
||||
Short: "Copy an existing image",
|
||||
Long: "This command will duplicate an imported image.",
|
||||
RunE: CobraRunE,
|
||||
Args: cobra.MinimumNArgs(2),
|
||||
Args: cobra.ExactArgs(2),
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
if len(args) != 0 {
|
||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||
|
||||
Reference in New Issue
Block a user