Skip to content

Commit

Permalink
add aliases to a few commands (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskim06 authored Nov 14, 2023
1 parent 2e6cfb3 commit efaaa22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions cmd/krew/cmd/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ var indexListCmd = &cobra.Command{
This command prints a list of indexes. It shows the name and the remote URL for
each configured index in table format.`,
Args: cobra.NoArgs,
Aliases: []string{"ls"},
Args: cobra.NoArgs,
RunE: func(_ *cobra.Command, _ []string) error {
indexes, err := indexoperations.ListIndexes(paths)
if err != nil {
Expand Down Expand Up @@ -95,8 +96,9 @@ It is only safe to remove indexes without installed plugins. Removing an index
while there are plugins installed will result in an error, unless the --force
option is used (not recommended).`,

Args: cobra.ExactArgs(1),
RunE: indexDelete,
Aliases: []string{"rm"},
Args: cobra.ExactArgs(1),
RunE: indexDelete,
}

func indexDelete(_ *cobra.Command, args []string) error {
Expand Down
1 change: 1 addition & 0 deletions cmd/krew/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Remarks:
Redirecting the output of this command to a program or file will only print
the names of the plugins installed. This output can be piped back to the
"install" command.`,
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, args []string) error {
receipts, err := installation.GetInstalledPluginReceipts(paths.InstallReceiptsPath())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/krew/cmd/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Remarks:
},
PreRunE: checkIndex,
Args: cobra.MinimumNArgs(1),
Aliases: []string{"remove"},
Aliases: []string{"remove", "rm"},
}

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

0 comments on commit efaaa22

Please sign in to comment.