summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-03-01 16:01:25 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-02-29 15:34:28 -0800
commit496f0b6d26daf5eb60f662cb47ba44b31d91e1cd (patch)
tree7d87429c7bd2a19fcaaa1c2d59584257924afa5b
parent1b4dd198a7f9e29eec3893bef0e3cfbaf2a43395 (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.go6
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)
+ }
},
}