From 138305b365307a30d151ff144d5a1e0d95723293 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Tue, 28 Oct 2008 02:23:13 -0600 Subject: Added an example CLI-specific env command --- ipalib/cli.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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, ) -- cgit