diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-10-28 02:23:13 -0600 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-10-28 02:23:13 -0600 |
commit | 138305b365307a30d151ff144d5a1e0d95723293 (patch) | |
tree | 1a1b58c0c9fc9d4e3c71b77ed4f9623b0bc7234b /ipalib/cli.py | |
parent | fbcb55bd11d17dbff8ec3c7c99cf7b3bb91d3752 (diff) | |
download | freeipa-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.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py index 6407e9e20..021e01ada 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, ) |