diff options
author | jtimberman <joshua@opscode.com> | 2009-06-17 22:11:22 -0600 |
---|---|---|
committer | jtimberman <joshua@opscode.com> | 2009-06-17 22:11:22 -0600 |
commit | 98ae83de837e43d0390329e141393b7d3d0584f8 (patch) | |
tree | a9d6e9ab3f6fd521f2ffbbc43efc183a1e459389 /bin | |
parent | cfea6505c0df5be1451317ebaa855809802719f1 (diff) | |
download | ohai-98ae83de837e43d0390329e141393b7d3d0584f8.tar.gz |
ohai-6, preliminary support for returning named attributes, toplevel only
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ohai | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -42,12 +42,17 @@ opts = OptionParser.new do |opts| opts.on("-l", "--loglevel NAME", "Set log level for Ohai") do |l| config[:log_level] = l.to_sym end + opts.on("-v", "--version", "Display Ohai version") do |v| + puts "Ohai, version #{::Ohai::VERSION}" + exit + end opts.on_tail("-h", "--help", "Show this message") do puts opts exit end end -opts.parse!(ARGV) + +attributes = opts.parse(ARGV) ohai = Ohai::System.new @@ -63,4 +68,10 @@ else ohai.all_plugins end -puts ohai.json_pretty_print +if attributes.length > 0 + attributes.each do |a| + puts ohai.attributes_print(a) + end +else + puts ohai.json_pretty_print +end
\ No newline at end of file |