diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f358c75..8047a42d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/internal/app/wwctl/container/delete/root.go b/internal/app/wwctl/container/delete/root.go index 2a8b9e1e..4a9d7649 100644 --- a/internal/app/wwctl/container/delete/root.go +++ b/internal/app/wwctl/container/delete/root.go @@ -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, diff --git a/internal/app/wwctl/container/imprt/root.go b/internal/app/wwctl/container/imprt/root.go index 7c416e85..d915b2b7 100644 --- a/internal/app/wwctl/container/imprt/root.go +++ b/internal/app/wwctl/container/imprt/root.go @@ -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: diff --git a/internal/app/wwctl/container/shell/root.go b/internal/app/wwctl/container/shell/root.go index df07eb18..cceb7512 100644 --- a/internal/app/wwctl/container/shell/root.go +++ b/internal/app/wwctl/container/shell/root.go @@ -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) { diff --git a/internal/app/wwctl/container/show/root.go b/internal/app/wwctl/container/show/root.go index 2ac72895..30d3e1a8 100644 --- a/internal/app/wwctl/container/show/root.go +++ b/internal/app/wwctl/container/show/root.go @@ -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 { diff --git a/internal/app/wwctl/kernel/delete/root.go b/internal/app/wwctl/kernel/delete/root.go index dc6ab3a6..187ea731 100644 --- a/internal/app/wwctl/kernel/delete/root.go +++ b/internal/app/wwctl/kernel/delete/root.go @@ -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) { diff --git a/internal/app/wwctl/kernel/imprt/root.go b/internal/app/wwctl/kernel/imprt/root.go index 1e9df72e..8a071d31 100644 --- a/internal/app/wwctl/kernel/imprt/root.go +++ b/internal/app/wwctl/kernel/imprt/root.go @@ -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), } diff --git a/internal/app/wwctl/node/add/root.go b/internal/app/wwctl/node/add/root.go index c7401a24..9f37cf0e 100644 --- a/internal/app/wwctl/node/add/root.go +++ b/internal/app/wwctl/node/add/root.go @@ -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), } diff --git a/internal/app/wwctl/node/delete/root.go b/internal/app/wwctl/node/delete/root.go index dbe81c0f..7c3f99b1 100644 --- a/internal/app/wwctl/node/delete/root.go +++ b/internal/app/wwctl/node/delete/root.go @@ -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 diff --git a/internal/app/wwctl/node/set/root.go b/internal/app/wwctl/node/set/root.go index dd1f42fa..7adbc44d 100644 --- a/internal/app/wwctl/node/set/root.go +++ b/internal/app/wwctl/node/set/root.go @@ -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) { diff --git a/internal/app/wwctl/overlay/create/root.go b/internal/app/wwctl/overlay/create/root.go index 881e07e0..ebc1ca1f 100644 --- a/internal/app/wwctl/overlay/create/root.go +++ b/internal/app/wwctl/overlay/create/root.go @@ -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), diff --git a/internal/app/wwctl/overlay/delete/root.go b/internal/app/wwctl/overlay/delete/root.go index 405c07fc..1de69417 100644 --- a/internal/app/wwctl/overlay/delete/root.go +++ b/internal/app/wwctl/overlay/delete/root.go @@ -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 diff --git a/internal/app/wwctl/profile/add/root.go b/internal/app/wwctl/profile/add/root.go index cc64c565..553806c8 100644 --- a/internal/app/wwctl/profile/add/root.go +++ b/internal/app/wwctl/profile/add/root.go @@ -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), } diff --git a/internal/app/wwctl/profile/delete/root.go b/internal/app/wwctl/profile/delete/root.go index 530cd55f..4f96882f 100644 --- a/internal/app/wwctl/profile/delete/root.go +++ b/internal/app/wwctl/profile/delete/root.go @@ -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) { diff --git a/internal/app/wwctl/profile/set/root.go b/internal/app/wwctl/profile/set/root.go index 2db99898..2c95e5a7 100644 --- a/internal/app/wwctl/profile/set/root.go +++ b/internal/app/wwctl/profile/set/root.go @@ -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