diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-03-01 16:01:25 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-02-29 15:34:28 -0800 |
commit | 496f0b6d26daf5eb60f662cb47ba44b31d91e1cd (patch) | |
tree | 7d87429c7bd2a19fcaaa1c2d59584257924afa5b | |
parent | 1b4dd198a7f9e29eec3893bef0e3cfbaf2a43395 (diff) |
cli: show help message when no argument passed
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | gobgp/cmd/root.go | 6 |
1 files changed, 5 insertions, 1 deletions
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) + } }, } |