#!/usr/bin/ruby require 'optparse' options = {} optparse = OptionParser.new do |opts| opts.banner = "Usage: spire create app" opts.on('-h', '--help', 'Displays this usage screen') do puts optparse exit end opts.on('-c', '-create DIR', 'Creates a new app/project with given name.') do |params| options[:create] = params end end begin optparse.parse! rescue OptionParser::InvalidOption puts optparse exit 1 end if options[:create] unless Dir.exists?(options[:create]) system("git clone git://github.com/snicol/spire-base-app.git #{options[:create]}") end else puts "No arguments given!" end