Added an example CLI-specific env command

This commit is contained in:
Jason Gerard DeRose
2008-10-28 02:23:13 -06:00
parent fbcb55bd11
commit 138305b365

View File

@@ -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,
)