From 9a9d976a8c583555215f84d4db08a7c0b58c6e06 Mon Sep 17 00:00:00 2001 From: Ryosuke Kato Date: Tue, 7 Nov 2023 10:20:25 +0900 Subject: [PATCH] fix: format&unintentional deletion --- src/north/cli/goldstone/north/cli/interface.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/north/cli/goldstone/north/cli/interface.py b/src/north/cli/goldstone/north/cli/interface.py index c17a0b80..00a573d0 100644 --- a/src/north/cli/goldstone/north/cli/interface.py +++ b/src/north/cli/goldstone/north/cli/interface.py @@ -1089,8 +1089,22 @@ def exec(self, line): model = self.model show_counters(self.conn, ifnames, table, model) - - + + +class InterfaceShowCommand(Command): + COMMAND_DICT = {"counters": InterfaceCounterCommand} + + def __init__(self, context, parent, name, **options): + self.model = options.get("model", "goldstone-interfaces") + super().__init__(context, parent, name, **options) + + def exec(self, line): + if len(line) != 0: + return self.context.root().exec(f"show {' '.join(line)}") + else: + show(self.conn, self.context.ifnames, self.model) + + class InterfaceContext(Context): REGISTERED_COMMANDS = {} OBJECT_NAME = "interface"