summaryrefslogtreecommitdiffhomepage
path: root/cli/gobgpcli
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-02-24 12:41:38 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-02-24 12:41:38 +0900
commitb5ed005e968d37b94eae168e733e550c69182c6d (patch)
tree6bef3f16b0ac95993b28f3c29e9aecd391cef4cd /cli/gobgpcli
parentef594f98c0f4c7a79b1323dee4b24ef563117586 (diff)
cli: show error if unsupported command is specified
$ gobgpcli show neighbor 10.0.255.1 adj-i adj-i : No such command Usage: gobpgcli [options] <command> <args> Options: -h, --help show this help message and exit -u URL, --url=URL specifying an url (http://localhost by default) -p PORT, --port=PORT specifying a port (8080 by default) -d, --debug dump raw json Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'cli/gobgpcli')
-rwxr-xr-xcli/gobgpcli10
1 files changed, 7 insertions, 3 deletions
diff --git a/cli/gobgpcli b/cli/gobgpcli
index e345e337..5465758c 100755
--- a/cli/gobgpcli
+++ b/cli/gobgpcli
@@ -260,12 +260,16 @@ class Show(object):
return 1
if len(self.args) == 2:
return self._neighbor(neighbor=self.args[1])
- if self.args[2] == "local":
+ if self.args[2] in ("local", "local-rib"):
self.args[2] = "local-rib"
- if self.args[2] == "received-routes":
+ elif self.args[2] in ("received-routes", "adj-rib-in", "adj-in"):
self.args[2] = "adj-rib-in"
- if self.args[2] == "advertised-routes":
+ elif self.args[2] in ("advertised-routes", "adj-rib-out", "adj-out"):
self.args[2] = "adj-rib-out"
+ else:
+ print self.args[2], ": No such command"
+ return 1
+
try:
r = requests.get(self.base_url + "/neighbor/" + self.args[1] + "/" + self.args[2])
except: