Sha256: 31a438f535e1bdf45880bd046558c6d44c75cc15a099cebb394622ca0dfb8e60

Contents?: true

Size: 747 Bytes

Versions: 10

Compression:

Stored size: 747 Bytes

Contents

require 'optparse'

@actions_path = File.join(File.dirname(__FILE__), 'actions')

if not ARGV[0].nil? and not ARGV[0].empty?
  action_name = ARGV[0]
  action = File.join(@actions_path, action_name)
  begin
    require action
  rescue
    puts "unknown action: #{action_name}"
  end
end

# if we got here, there was either no action, or the action was invalid
OptionParser.new do |opts|
  opts.banner = "Archetype command line actions\n\n"
  opts.define_head "Usage: archetype <action> [options]"
  opts.separator ""
  opts.separator "Available Actions:"
  Dir.glob("#{@actions_path}/*.rb") do |action|
    @description = true
    load action
    opts.separator "  * #{File.basename(action, '.rb')}\t- #{@description}"
  end
  puts opts
end.parse!

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
archetype-0.0.1.pre.13 lib/archetype/executor.rb
archetype-0.0.1.pre.10 lib/archetype/executor.rb
archetype-0.0.1.pre.9 lib/archetype/executor.rb
archetype-0.0.1.pre.8 lib/archetype/executor.rb
archetype-0.0.1.pre.7 lib/archetype/executor.rb
archetype-0.0.1.pre.6 lib/archetype/executor.rb
archetype-0.0.1.pre.5 lib/archetype/executor.rb
archetype-0.0.1.pre.4 lib/archetype/executor.rb
archetype-0.0.1.pre.3.90263a7 lib/archetype/executor.rb
archetype-0.0.1.pre.3.6ed259b lib/archetype/executor.rb