Sha256: 5fafa7928f660c2971f658f7838b1c6533b8ad0ab99ea6fcf8a59e56390c3f53

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

#!/usr/bin/env ruby

<% if add_library_to_load_path -%>
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '../lib'))

<% end -%>
require 'optparse'
require 'methadone'
require '<%= require_file %>'
require '<%= gemname %>/commands'

class App
  include Methadone::Main
  include Methadone::CLILogging

<% commands.each do |cmd| -%>
  command "<%= cmd %>" => <%= module_name %>::Commands::<%= titlify(normalize_command(cmd)) %>
<% end -%>

  main do # Add args you want: |like,so|
    # your program code here
    # You can access CLI options via
    # the options Hash
  end

  # supplemental methods here

  # Declare command-line interface here

  # description "one line description of your app"
  #
  # Accept flags via:
  # on("--flag VAL","Some flag")
  # options[flag] will contain VAL
  #
  # Specify switches via:
  # on("--[no-]switch","Some switch")
  #
  # Or, just call OptionParser methods on opts
  #
  # Require an argument
  # arg :some_arg 
  #
  # # Make an argument optional
  # arg :optional_arg, :optional

  version <%= module_name %>::VERSION

  use_log_level_option

  go!
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
methadone-rehab-1.9.2 templates/multicommand/bin/executable.erb