summaryrefslogtreecommitdiff
path: root/openstackclient/common/module.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-10-14 22:23:20 +0000
committerGerrit Code Review <review@openstack.org>2014-10-14 22:23:20 +0000
commitfa9cdef8740dffec347c8e9b1e75af7aae78c623 (patch)
treef85db85483a3c96828f03d0b5ba09159ba42a82f /openstackclient/common/module.py
parent1d9194d4cba7dd5d7211bea2a408cdf0faf249e4 (diff)
parentd32185cb34495b0af4b4e646a93aedf4d7f86d25 (diff)
downloadpython-openstackclient-fa9cdef8740dffec347c8e9b1e75af7aae78c623.tar.gz
Merge "Add 'command list' command"
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"""