summaryrefslogtreecommitdiff
path: root/openstackclient/common/module.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/common/module.py')
-rw-r--r--openstackclient/common/module.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/openstackclient/common/module.py b/openstackclient/common/module.py
index 7f9c52db..356cdca3 100644
--- a/openstackclient/common/module.py
+++ b/openstackclient/common/module.py
@@ -19,9 +19,25 @@ import logging
import six
import sys
+from cliff import lister
from cliff import show
+class ListCommand(lister.Lister):
+ """List recognized commands by group"""
+
+ auth_required = False
+ log = logging.getLogger(__name__ + '.ListCommand')
+
+ def take_action(self, parsed_args):
+ self.log.debug('take_action(%s)', parsed_args)
+ cm = self.app.command_manager
+ groups = cm.get_command_groups()
+
+ columns = ('Command Group', 'Commands')
+ return (columns, ((c, cm.get_command_names(group=c)) for c in groups))
+
+
class ListModule(show.ShowOne):
"""List module versions"""