diff --git a/src/exabgp/reactor/api/command/neighbor.py b/src/exabgp/reactor/api/command/neighbor.py index c61b645b0..162439d4b 100644 --- a/src/exabgp/reactor/api/command/neighbor.py +++ b/src/exabgp/reactor/api/command/neighbor.py @@ -199,7 +199,9 @@ def teardown(self, reactor, service, line): return False -@Command.register('text', 'show neighbor', False, ['summary', 'extensive', 'configuration', 'json']) +@Command.register('text', 'show neighbor', False, ['summary', 'extensive', 'configuration']) +@Command.register('text', 'show neighbor text', False, ['summary', 'extensive', 'configuration']) +@Command.register('json', 'show neighbor json', False, ['summary', 'extensive', 'configuration']) def show_neighbor(self, reactor, service, command): words = command.split() @@ -207,6 +209,7 @@ def show_neighbor(self, reactor, service, command): configuration = 'configuration' in words summary = 'summary' in words jason = 'json' in words + text = 'text' in words if summary: words.remove('summary') @@ -216,6 +219,10 @@ def show_neighbor(self, reactor, service, command): words.remove('configuration') if jason: words.remove('json') + if text: + words.remove('text') + + use_json = json and not text limit = words[-1] if words[-1] != 'neighbor' else '' @@ -259,7 +266,7 @@ def callback_summary(): yield True reactor.processes.answer_done(service) - if jason: + if use_json: reactor.asynchronous.schedule(service, command, callback_json()) return True