From 496f0b6d26daf5eb60f662cb47ba44b31d91e1cd Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Tue, 1 Mar 2016 16:01:25 +0900 Subject: cli: show help message when no argument passed Signed-off-by: ISHIDA Wataru --- gobgp/cmd/root.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gobgp/cmd/root.go b/gobgp/cmd/root.go index 6ded72e7..58028881 100644 --- a/gobgp/cmd/root.go +++ b/gobgp/cmd/root.go @@ -44,7 +44,11 @@ func NewRootCmd() *cobra.Command { } }, Run: func(cmd *cobra.Command, args []string) { - cmd.GenBashCompletionFile(globalOpts.BashCmplFile) + if globalOpts.GenCmpl { + cmd.GenBashCompletionFile(globalOpts.BashCmplFile) + } else { + cmd.HelpFunc()(cmd, args) + } }, } -- cgit v1.2.3