Skip to content

Commit efaaa22

Browse files
authored
add aliases to a few commands (#839)
1 parent 2e6cfb3 commit efaaa22

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

cmd/krew/cmd/index.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ var indexListCmd = &cobra.Command{
4848
4949
This command prints a list of indexes. It shows the name and the remote URL for
5050
each configured index in table format.`,
51-
Args: cobra.NoArgs,
51+
Aliases: []string{"ls"},
52+
Args: cobra.NoArgs,
5253
RunE: func(_ *cobra.Command, _ []string) error {
5354
indexes, err := indexoperations.ListIndexes(paths)
5455
if err != nil {
@@ -95,8 +96,9 @@ It is only safe to remove indexes without installed plugins. Removing an index
9596
while there are plugins installed will result in an error, unless the --force
9697
option is used (not recommended).`,
9798

98-
Args: cobra.ExactArgs(1),
99-
RunE: indexDelete,
99+
Aliases: []string{"rm"},
100+
Args: cobra.ExactArgs(1),
101+
RunE: indexDelete,
100102
}
101103

102104
func indexDelete(_ *cobra.Command, args []string) error {

cmd/krew/cmd/list.go

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Remarks:
3939
Redirecting the output of this command to a program or file will only print
4040
the names of the plugins installed. This output can be piped back to the
4141
"install" command.`,
42+
Aliases: []string{"ls"},
4243
RunE: func(cmd *cobra.Command, args []string) error {
4344
receipts, err := installation.GetInstalledPluginReceipts(paths.InstallReceiptsPath())
4445
if err != nil {

cmd/krew/cmd/uninstall.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Remarks:
5454
},
5555
PreRunE: checkIndex,
5656
Args: cobra.MinimumNArgs(1),
57-
Aliases: []string{"remove"},
57+
Aliases: []string{"remove", "rm"},
5858
}
5959

6060
func unsafePluginNameErr(n string) error { return errors.Errorf("plugin name %q not allowed", n) }

0 commit comments

Comments
 (0)