diff options
author | Benjamin Black <bb@joyeuse.local> | 2009-02-26 14:44:16 -0800 |
---|---|---|
committer | Benjamin Black <bb@joyeuse.local> | 2009-02-26 14:44:16 -0800 |
commit | 1f8fe1dae97a2e459800d9b9753d4a37283fa2a9 (patch) | |
tree | 569d73ce9758f88579305cd8322bf8bcffb2ce63 /bin/ohai | |
parent | b6c41e00d7b68fd4e76b749af2b6c2e0a765bc7c (diff) | |
download | ohai-1f8fe1dae97a2e459800d9b9753d4a37283fa2a9.tar.gz |
[OHAI-57] added debug option (which is extremely verbose)
Diffstat (limited to 'bin/ohai')
-rwxr-xr-x | bin/ohai | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -30,6 +30,7 @@ config = { :file => nil } +with_debug = false opts = OptionParser.new do |opts| opts.banner = "Usage: #{$0} (options)" opts.on("-d", "--directory NAME", "A directory to add to the Ohai search path") do |d| @@ -38,6 +39,9 @@ opts = OptionParser.new do |opts| opts.on("-f", "--file NAME", "A file to run Ohai against") do |f| config[:file] = f end + opts.on("-g", "--debug", "Turn on (extremely verbose) debugging") do |f| + with_debug = true + end opts.on_tail("-h", "--help", "Show this message") do puts opts exit @@ -46,6 +50,9 @@ end opts.parse!(ARGV) ohai = Ohai::System.new +if with_debug + Ohai::Config[:log_level] = :debug +end if config[:file] ohai.from_file(config[:file]) else |