Sha256: 499a66cb3b8b97438845eeab046b2a91faf3e1d6f0ab5221d2533841ec22b606

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby

require "#{File.dirname(__FILE__)}/../lib/divvy"
require 'optparse'
require 'ostruct'

options = OpenStruct.new
options.verbose = false
options.test = false

parser = OptionParser.new do |opts|
  opts.banner = <<BANNER
Divvy
=====

Divvy is a software provisioning tool you canuse to build remote servers with. 

Usage
=====

$> #{File.basename($0)} [options]

Options are:
BANNER
  opts.separator ""
  
  opts.on("-s", "--script=PATH", "The divvy script to run") do |script|
    options.script = script
  end

  opts.on("-t", "--[no-]test", "Process but do not perform actions") do |t|
    options.test = t
  end
  opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
    options.verbose = v
  end

  opts.on("-h", "--help", "Show this help message.") { puts opts; exit }
  opts.parse!(ARGV)
  
  unless options.script
    puts "script is required"
    puts opts
    exit
  end
  
end

Divvy.init

Divvy.test = options.test
Divvy.verbose = options.verbose

Divvy.run(File.read(options.script), options.script)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
michaeldwan-divvy-0.1.2 bin/divvy
michaeldwan-divvy-0.1.5 bin/divvy