wwctl profile args and completions

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-02-09 13:42:16 -07:00
parent 32b9696b71
commit 3fbc2fc75c
6 changed files with 20 additions and 61 deletions

View File

@@ -37,9 +37,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
if np == r {
wwlog.Verbose("Removing profile from node %s: %s", n.Id(), r)
n.Profiles = append(n.Profiles[:i], n.Profiles[i+1:]...)
if err != nil {
return fmt.Errorf("failed to update node: %w", err)
}
}
}
}

View File

@@ -14,7 +14,7 @@ var (
Aliases: []string{"remove", "rm", "del"},
RunE: CobraRunE,
Args: cobra.MinimumNArgs(1),
ValidArgsFunction: completions.Profiles,
ValidArgsFunction: completions.Profiles(0), // no limit
}
SetYes bool
)