Sha256: 74ba8e729a49020ee29a42c69739fdff9e3a4eedfba18991d4a6959ebec0cf57
Contents?: true
Size: 961 Bytes
Versions: 21
Compression:
Stored size: 961 Bytes
Contents
require 'optparse' module SystemBuilder class CLI def self.execute(stdout, arguments=[]) options = {} mandatory_options = %w(config) OptionParser.new do |opts| opts.banner = <<-BANNER.gsub(/^ /,'') Create and configure bootable systems Usage: #{File.basename($0)} [options] image command Options are: BANNER opts.separator "" opts.on("-c", "--config=FILE", String, "The file containing image and boot definitions") { |arg| options[:config] = arg } opts.on("-h", "--help", "Show this help message.") { stdout.puts opts; exit } opts.parse!(arguments) if mandatory_options && mandatory_options.find { |option| options[option.to_sym].nil? } stdout.puts opts; exit end end load options[:config] image = SystemBuilder.configuration(arguments.unshift) image.create end end end
Version data entries
21 entries across 21 versions & 2 rubygems