Sha256: b068b879ab3dc91af9f2875319c2c1cd46f42f7e5b92588df581f26aadf5f2e0

Contents?: true

Size: 951 Bytes

Versions: 1

Compression:

Stored size: 951 Bytes

Contents

require 'optparse'
require 'methadone'

module <%= module_name %> 
  module Commands
    class <%= titlify(normalize_command(cmd)) %>
      include Methadone::Main
      include Methadone::CLILogging

      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"
      description "provides command '<%= cmd -%>'"
      
      # 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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
methadone-rehab-1.9.2 templates/multicommand/lib/command.rb.erb