From ae236ba03db5d6e0f971e0e711cd333f77b85982 Mon Sep 17 00:00:00 2001 From: David Simansky Date: Thu, 13 Feb 2020 10:43:23 +0100 Subject: [PATCH] fix(help): initialize default help cmd early --- pkg/kn/core/root.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/kn/core/root.go b/pkg/kn/core/root.go index c6ea75d83b..4f5700cd3b 100644 --- a/pkg/kn/core/root.go +++ b/pkg/kn/core/root.go @@ -152,6 +152,9 @@ func NewKnCommand(params ...commands.KnParams) *cobra.Command { rootCmd.AddCommand(source.NewSourceCommand(p)) rootCmd.AddCommand(trigger.NewTriggerCommand(p)) + // Initialize default `help` cmd early to prevent unknown command errors + rootCmd.InitDefaultHelpCmd() + // Deal with empty and unknown sub command groups EmptyAndUnknownSubCommands(rootCmd)