From 0922744d36bfb57b55574bead01ce0ecb656c667 Mon Sep 17 00:00:00 2001 From: Tharun Date: Fri, 26 Mar 2021 23:18:35 +0530 Subject: [PATCH] add unload as an alias Signed-off-by: Tharun --- cmd/minikube/cmd/image.go | 13 +++++++++---- pkg/generate/docs.go | 5 +++++ site/content/en/docs/commands/image.md | 10 +++++++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/cmd/minikube/cmd/image.go b/cmd/minikube/cmd/image.go index c0d80d654583..74bae17a0e15 100644 --- a/cmd/minikube/cmd/image.go +++ b/cmd/minikube/cmd/image.go @@ -126,10 +126,15 @@ var loadImageCmd = &cobra.Command{ } var removeImageCmd = &cobra.Command{ - Use: "rm IMAGE [IMAGE...]", - Short: "Remove one or more images", - Long: "Remove a image from minikube", - Example: "minikube image rm image busybox", + Use: "rm IMAGE [IMAGE...]", + Short: "Remove one or more images", + Long: "Remove a image from minikube", + Example: ` +$ minikube image rm image busybox + +$ minikube image unload image busybox +`, + Aliases: []string{"unload"}, Run: func(cmd *cobra.Command, args []string) { if len(args) == 0 { exit.Message(reason.Usage, "Please provide an image to remove via ") diff --git a/pkg/generate/docs.go b/pkg/generate/docs.go index 17a2c2cad1b4..b8cbcded797e 100644 --- a/pkg/generate/docs.go +++ b/pkg/generate/docs.go @@ -96,6 +96,11 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) buf.WriteString(fmt.Sprintf("```shell\n%s\n```\n\n", cmd.UseLine())) } + if len(cmd.Aliases) > 0 { + buf.WriteString("### Aliases\n\n") + buf.WriteString(fmt.Sprintf("%s\n\n", cmd.Aliases)) + } + if len(cmd.Example) > 0 { buf.WriteString("### Examples\n\n") buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example)) diff --git a/site/content/en/docs/commands/image.md b/site/content/en/docs/commands/image.md index 1ca651be8e64..8084441290d8 100644 --- a/site/content/en/docs/commands/image.md +++ b/site/content/en/docs/commands/image.md @@ -130,10 +130,18 @@ Remove a image from minikube minikube image rm IMAGE [IMAGE...] [flags] ``` +### Aliases + +[unload] + ### Examples ``` -minikube image rm image busybox + +$ minikube image rm image busybox + +$ minikube image unload image busybox + ``` ### Options inherited from parent commands