summaryrefslogtreecommitdiffstats
path: root/ipalib/cli.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-10-28 02:23:13 -0600
committerJason Gerard DeRose <jderose@redhat.com>2008-10-28 02:23:13 -0600
commit138305b365307a30d151ff144d5a1e0d95723293 (patch)
tree1a1b58c0c9fc9d4e3c71b77ed4f9623b0bc7234b /ipalib/cli.py
parentfbcb55bd11d17dbff8ec3c7c99cf7b3bb91d3752 (diff)
downloadfreeipa-138305b365307a30d151ff144d5a1e0d95723293.tar.gz
freeipa-138305b365307a30d151ff144d5a1e0d95723293.tar.xz
freeipa-138305b365307a30d151ff144d5a1e0d95723293.zip
Added an example CLI-specific env command
Diffstat (limited to 'ipalib/cli.py')
-rw-r--r--ipalib/cli.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 6407e9e2..021e01ad 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -97,6 +97,21 @@ class console(frontend.Application):
)
+class env(frontend.Application):
+ """
+ Show environment variables.
+ """
+
+ def run(self):
+ return tuple(
+ (key, self.api.env[key]) for key in self.api.env
+ )
+
+ def output_for_cli(self, ret):
+ for (key, value) in ret:
+ print '%s = %r' % (key, value)
+
+
class show_api(text_ui):
'Show attributes on dynamic API object'
@@ -183,6 +198,7 @@ cli_application_commands = (
console,
show_api,
plugins,
+ env,
)