diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-01-10 20:00:39 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-01-10 20:03:23 +0900 |
commit | 84818b155c5ad3a9899331c1ec894166b2c360e2 (patch) | |
tree | 6c9bb5fb290245395ca5af4a8a7106b26dc24c2d | |
parent | 127e81dc75cce9adc9330ad45e4dc95f04a171fa (diff) |
cli: handle -j option when showing policy statement
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | gobgp/cmd/policy.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gobgp/cmd/policy.go b/gobgp/cmd/policy.go index de604c2e..3913f95b 100644 --- a/gobgp/cmd/policy.go +++ b/gobgp/cmd/policy.go @@ -554,6 +554,11 @@ func showStatement(args []string) error { m = append(m, p) } } + if globalOpts.Json { + j, _ := json.Marshal(m) + fmt.Println(string(j)) + return nil + } if globalOpts.Quiet { for _, s := range m { fmt.Println(s.Name) |