From e174a40cf5ac0768181065462ef36ec1ad07470c Mon Sep 17 00:00:00 2001 From: Kevin Darlington Date: Sun, 2 Feb 2014 22:20:55 -0500 Subject: [PATCH] Print root usage when help called with no args. --- command.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/command.go b/command.go index 6b6811df..73d009f7 100644 --- a/command.go +++ b/command.go @@ -19,10 +19,11 @@ package cobra import ( "bytes" "fmt" - flag "github.com/spf13/pflag" "io" "os" "strings" + + flag "github.com/spf13/pflag" ) // Command is just that, a command for your application. @@ -137,7 +138,7 @@ func (c *Command) HelpFunc() func(*Command, []string) { return func(c *Command, args []string) { if len(args) == 0 { // Help called without any topic, calling on root - c.Root().Help() + c.Root().Usage() return }