added more aliases for wwctl commands

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2024-03-18 14:41:18 +01:00
committed by Jonathon Anderson
parent 2805122c12
commit 17a5aaefee
15 changed files with 17 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`interface` with the interface MAC address
- Added https://github.com/Masterminds/sprig functions to templates #1030
- Add multiple output formats (yaml & json) support. #447
- More aliases for many wwctl commands
### Changed

View File

@@ -9,6 +9,7 @@ var (
baseCmd = &cobra.Command{
DisableFlagsInUseLine: true,
Use: "delete [OPTIONS] CONTAINER [...]",
Aliases: []string{"rm", "remove", "del"},
Short: "Delete an imported container",
Long: "This command will delete CONTAINERs that have been imported into Warewulf.",
RunE: CobraRunE,

View File

@@ -10,6 +10,7 @@ var (
DisableFlagsInUseLine: true,
Use: "import [OPTIONS] SOURCE [NAME]",
Short: "Import a container into Warewulf",
Aliases: []string{"pull"},
Long: `This command will pull and import a container into Warewulf from SOURCE,
optionally renaming it to NAME. The SOURCE must be in a supported URI format. Formats
are:

View File

@@ -11,6 +11,7 @@ var (
Use: "shell [OPTIONS] CONTAINER",
Short: "Run a shell inside of a Warewulf container",
Long: "Run a interactive shell inside of a warewulf CONTAINER.\n",
Aliases: []string{"chroot"},
RunE: CobraRunE,
Args: cobra.MinimumNArgs(1),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {

View File

@@ -11,7 +11,7 @@ var (
Use: "show [OPTIONS] CONTAINER",
Short: "Show root fs dir for container",
Long: `Shows the base directory for the chroot of the given container.
More information about the conainer can be shown with the '-a' option.`,
More information about the container can be shown with the '-a' option.`,
RunE: CobraRunE,
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) != 0 {

View File

@@ -11,6 +11,7 @@ var (
Use: "delete [OPTIONS] KERNEL [...]",
Short: "Delete imported kernels",
Long: "This command will delete KERNEL versions that have been imported into Warewulf.",
Aliases: []string{"rm", "del", "remove"},
RunE: CobraRunE,
Args: cobra.MinimumNArgs(1),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {

View File

@@ -13,6 +13,7 @@ var (
Use: "import [OPTIONS] KERNEL",
Short: "Import Kernel version into Warewulf",
Long: "This will import a boot KERNEL version from the control node into Warewulf",
Aliases: []string{"pull"},
RunE: CobraRunE,
Args: cobra.MinimumNArgs(0),
}

View File

@@ -29,6 +29,7 @@ func GetCommand() *cobra.Command {
Use: "add [OPTIONS] NODENAME",
Short: "Add new node to Warewulf",
Long: "This command will add a new node named NODENAME to Warewulf.",
Aliases: []string{"new", "create"},
RunE: CobraRunE(&vars),
Args: cobra.MinimumNArgs(1),
}

View File

@@ -13,7 +13,7 @@ var (
Long: "This command will remove NODE(s) from the Warewulf node configuration.",
Args: cobra.MinimumNArgs(1),
RunE: CobraRunE,
Aliases: []string{"rm", "del"},
Aliases: []string{"rm", "del", "remove"},
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) != 0 {
return nil, cobra.ShellCompDirectiveNoFileComp

View File

@@ -34,6 +34,7 @@ func GetCommand() *cobra.Command {
Use: "set [OPTIONS] PATTERN [PATTERN ...]",
Short: "Configure node properties",
Long: "This command sets configuration properties for nodes matching PATTERN.\n\nNote: use the string 'UNSET' to remove a configuration",
Aliases: []string{"modify"},
Args: cobra.MinimumNArgs(0),
RunE: CobraRunE(&vars),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {

View File

@@ -9,6 +9,7 @@ var (
DisableFlagsInUseLine: true,
Use: "create [OPTIONS] OVERLAY_NAME",
Short: "Initialize a new Overlay",
Aliases: []string{"new", "add"},
Long: "This command creates a new empty overlay with the given OVERLAY_NAME.",
RunE: CobraRunE,
Args: cobra.ExactArgs(1),

View File

@@ -13,7 +13,7 @@ var (
Long: "This command will delete FILEs within OVERLAY_NAME or the entire OVERLAY_NAME if no\nfiles are listed. Use with caution!",
RunE: CobraRunE,
Args: cobra.RangeArgs(1, 2),
Aliases: []string{"rm", "del"},
Aliases: []string{"rm", "remove", "del"},
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) != 0 {
return nil, cobra.ShellCompDirectiveNoFileComp

View File

@@ -33,6 +33,7 @@ func GetCommand() *cobra.Command {
Use: "add PROFILE",
Short: "Add a new node profile",
Long: "This command adds a new named PROFILE.",
Aliases: []string{"new", "create"},
RunE: CobraRunE(&vars),
Args: cobra.ExactArgs(1),
}

View File

@@ -11,6 +11,7 @@ var (
Use: "delete [OPTIONS] PROFILE",
Short: "Delete a node profile",
Long: "This command deletes the node PROFILE. You may use a pattern for PROFILE.",
Aliases: []string{"remove", "rm", "del"},
RunE: CobraRunE,
Args: cobra.MinimumNArgs(1),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {

View File

@@ -35,8 +35,9 @@ func GetCommand() *cobra.Command {
Short: "Configure node profile properties",
Long: "This command sets configuration properties for the node PROFILE(s).\n\n" +
"Note: use the string 'UNSET' to remove a configuration",
Args: cobra.MinimumNArgs(0),
RunE: CobraRunE(&vars),
Aliases: []string{"modify"},
Args: cobra.MinimumNArgs(0),
RunE: CobraRunE(&vars),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) != 0 {
return nil, cobra.ShellCompDirectiveNoFileComp