diff --git a/show/main.py b/show/main.py index 83e5ea848a..abf1558667 100755 --- a/show/main.py +++ b/show/main.py @@ -865,10 +865,17 @@ def tacacs(): # -# 'session' command ### +# 'mirror' group ### # -@cli.command() +@cli.group(cls=AliasedGroup, default_if_no_args=False) +def mirror(): + """Show mirroring (Everflow) information""" + pass + + +# 'session' subcommand ("show mirror session") +@mirror.command() @click.argument('session_name', required=False) def session(session_name): """Show existing everflow sessions""" @@ -888,39 +895,34 @@ def acl(): pass -# -# 'acl table' command ### -# - +# 'rule' subcommand ("show acl rule") @acl.command() @click.argument('table_name', required=False) -def table(table_name): - """Show existing ACL tables""" +@click.argument('rule_id', required=False) +def rule(table_name, rule_id): + """Show existing ACL rules""" if table_name is None: table_name = "" - run_command("acl-loader show table {}".format(table_name)) + if rule_id is None: + rule_id = "" + run_command("acl-loader show rule {} {}".format(table_name, rule_id)) -# -# 'acl rule' command ### -# +# 'table' subcommand ("show acl table") @acl.command() @click.argument('table_name', required=False) -@click.argument('rule_id', required=False) -def rule(table_name, rule_id): - """Show existing ACL rules""" +def table(table_name): + """Show existing ACL tables""" if table_name is None: table_name = "" - if rule_id is None: - rule_id = "" + run_command("acl-loader show table {}".format(table_name)) - run_command("acl-loader show rule {} {}".format(table_name, rule_id)) # -# 'session' command (show ecn) +# 'ecn' command ("show ecn") # @cli.command('ecn') def ecn():