diff options
| author | Luke Kanies <luke@puppetlabs.com> | 2011-02-27 16:34:10 -0800 |
|---|---|---|
| committer | Luke Kanies <luke@puppetlabs.com> | 2011-02-27 16:50:54 -0800 |
| commit | 905ff3aee31775e3fff3ebf8a2eaa6bb2cf0f431 (patch) | |
| tree | 1c5c017b19fa7992aea10f3f72efbd8523a14b3f /lib/puppet/application | |
| parent | 66c994ac43347c735f0ea4158b38557d32ec5747 (diff) | |
| download | puppet-905ff3aee31775e3fff3ebf8a2eaa6bb2cf0f431.tar.gz puppet-905ff3aee31775e3fff3ebf8a2eaa6bb2cf0f431.tar.xz puppet-905ff3aee31775e3fff3ebf8a2eaa6bb2cf0f431.zip | |
Pretty-printing json using "jj"
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'lib/puppet/application')
| -rw-r--r-- | lib/puppet/application/interface_base.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/puppet/application/interface_base.rb b/lib/puppet/application/interface_base.rb index 70022f17d..d54ac7922 100644 --- a/lib/puppet/application/interface_base.rb +++ b/lib/puppet/application/interface_base.rb @@ -52,7 +52,12 @@ class Puppet::Application::InterfaceBase < Puppet::Application # Override this if you need custom rendering. def render(result) render_method = Puppet::Network::FormatHandler.format(format).render_method - result.send(render_method) + if render_method == "to_pson" + jj result + exit(0) + else + result.send(render_method) + end end def setup |
