diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-20 07:22:24 +0000 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-20 07:22:24 +0000 |
commit | b7f47bc844be1e5969448c1cb4f485074610070f (patch) | |
tree | ec70abaf8f50ed1ce5a07dc087e0f94e19892479 | |
parent | 802879087ddf14da1c2dab90d05dd09debb747a7 (diff) |
cli: improve global command
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | gobgp/cmd/global.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gobgp/cmd/global.go b/gobgp/cmd/global.go index da4b623e..d13e8d21 100644 --- a/gobgp/cmd/global.go +++ b/gobgp/cmd/global.go @@ -943,6 +943,9 @@ func NewGlobalCmd() *cobra.Command { policyCmd := &cobra.Command{ Use: CMD_POLICY, Run: func(cmd *cobra.Command, args []string) { + if len(args) > 0 { + exitWithError(fmt.Errorf("usage: gobgp global policy [{ import | export }]")) + } for _, v := range []string{CMD_IMPORT, CMD_EXPORT} { if err := showNeighborPolicy(nil, v, 4); err != nil { exitWithError(err) @@ -951,7 +954,7 @@ func NewGlobalCmd() *cobra.Command { }, } - for _, v := range []string{CMD_IN, CMD_IMPORT, CMD_EXPORT} { + for _, v := range []string{CMD_IMPORT, CMD_EXPORT} { cmd := &cobra.Command{ Use: v, Run: func(cmd *cobra.Command, args []string) { |