From 6509ba72dfe1d1d7e372199bc474d1793b3a3334 Mon Sep 17 00:00:00 2001 From: rebeccasun31 Date: Thu, 23 Nov 2023 00:30:13 +0800 Subject: [PATCH] Documentation for built-in aliases --- pkg/cmd/root/help.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/cmd/root/help.go b/pkg/cmd/root/help.go index 860fb22c3..cfdbf2300 100644 --- a/pkg/cmd/root/help.go +++ b/pkg/cmd/root/help.go @@ -131,6 +131,10 @@ func rootHelpFunc(f *cmdutil.Factory, command *cobra.Command, args []string) { } helpEntries = append(helpEntries, helpEntry{"USAGE", command.UseLine()}) + if len(command.Aliases) > 0 { + helpEntries = append(helpEntries, helpEntry{"ALIASES", strings.Join(command.Aliases, "\n")}) + } + for _, g := range GroupedCommands(command) { var names []string for _, c := range g.Commands {