summaryrefslogtreecommitdiff
path: root/bin/ohai
diff options
context:
space:
mode:
authorBenjamin Black <bb@joyeuse.local>2009-02-26 14:44:16 -0800
committerBenjamin Black <bb@joyeuse.local>2009-02-26 14:44:16 -0800
commit1f8fe1dae97a2e459800d9b9753d4a37283fa2a9 (patch)
tree569d73ce9758f88579305cd8322bf8bcffb2ce63 /bin/ohai
parentb6c41e00d7b68fd4e76b749af2b6c2e0a765bc7c (diff)
downloadohai-1f8fe1dae97a2e459800d9b9753d4a37283fa2a9.tar.gz
[OHAI-57] added debug option (which is extremely verbose)
Diffstat (limited to 'bin/ohai')
-rwxr-xr-xbin/ohai7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/ohai b/bin/ohai
index fea22334..69f69ff1 100755
--- a/bin/ohai
+++ b/bin/ohai
@@ -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