Sha256: be65bac25ff3b42589706d300974d6473a7a79cc2347dc965901a8b40291f569
Contents?: true
Size: 1.43 KB
Versions: 1
Compression:
Stored size: 1.43 KB
Contents
#!/usr/bin/env ruby $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))) require 'core' Signal.trap("INT"){} ARGV << '-h' if ARGV.empty? options = {} OptionParser.new do |opts| opts.banner = "Generate starter code for different coding environments.\n\nUsage: #{File.basename($PROGRAM_NAME)} [options] [task] NewProjectName\nRadon version: #{Paint[VERSION, '#2ecc71']}" opts.separator Paint["\nGlobal Options: ", '#95a5a6'] opts.on('--list-env', 'List all supported environments') do all = Radon::Environments.getAllNames puts "Supported environments are:" all.each do |e| puts " #{e}" end end opts.on('-q', '--quiet', 'Run with suppresed console output.') do $quiet = true end opts.on('--verbose', 'Run verbosely') do $verbose = true end opts.on('-v', '--version', 'Show the krypton version and exit') do puts "Krypton version: #{Paint[VERSION, '#2ecc71']}" exit 0 end opts.on('-h', '--help', 'Show this help message') do puts opts exit end end.parse!(ARGV) while (opt = ARGV.shift) do Radon::Util.first_run if Radon::Environments.getAllNames.include? opt Radon::Environments.extract(opt, ARGV[0]) puts Paint["Done! Your project is set up in #{File.expand_path(ARGV[0])}.", :bold, :bright] exit 0 else error "#{opt} is not a supported environment!" exit 1 end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
radon-0.1.7 | bin/radon |