diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ohai | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/bin/ohai b/bin/ohai new file mode 100644 index 00000000..35ac641e --- /dev/null +++ b/bin/ohai @@ -0,0 +1,44 @@ +#!/usr/bin/env ruby +# +# ./ohai - I'm in ur serverz, showin you the daters +# +# Author:: Adam Jacob (<adam@opscode.com>) +# Copyright:: Copyright (c) 2008 OpsCode, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require 'optparse' +require 'rubygems' +#require 'ohai' +require 'json' + +config = { + :kthxbye => false +} + +opts = OptionParser.new do |opts| + opts.banner = "Usage: #{$0} [-d DIR|-r FILE] (options)" + opts.on("-k", "--kthxbye", "LOLcats") do |k| + config[:kthxbye] = true + end + opts.on_tail("-h", "--help", "Show this message") do + puts opts + exit + end +end +opts.parse!(ARGV) + +if config[:kthxbye] + puts JSON.generate({ :lolcat => "http://icanhascheezburger.com/?random" }) +end
\ No newline at end of file |