Sha256: d897f33e5ab2f02d08e6ee129ecd6cfc183f2bb00a7dc4e90d0a66965235b4de

Contents?: true

Size: 1.96 KB

Versions: 6

Compression:

Stored size: 1.96 KB

Contents

#!/usr/bin/env ruby
#
# BioRuby <%= project_name %> Plugin <%= constant_name %>
# Author:: <%= user_name %>
# Copyright:: <%= Time.now.year %>

 USAGE = "Describe <%= bin_name %>"

if ARGV.size == 0
  print USAGE
end

require '<%= project_name %>'
require 'optparse'

# Uncomment when using the bio-logger 
# require 'bio-logger'
# Bio::Log::CLI.logger('stderr')
# Bio::Log::CLI.trace('info')

options = {:example_switch=>false,:show_help=>false}
opts = OptionParser.new do |o|
  o.banner = "Usage: #{File.basename($0)} [options] reponame\ne.g. #{File.basename($0)} the-perfect-gem"

  o.on('--example_parameter [EXAMPLE_PARAMETER]', 'TODO: put a description for the PARAMETER') do |example_parameter|
    # TODO: your logic here, below an example
    options[:example_parameter] = 'this is a parameter'
  end
  
  o.separator ""
  o.on("--switch-example", 'TODO: put a description for the SWITCH') do
    # TODO: your logic here, below an example
    self[:example_switch] = true
  end

  # Uncomment the following when using the bio-logger 
  # o.separator ""
  # o.on("--logger filename",String,"Log to file (default stderr)") do | name |
  #   Bio::Log::CLI.logger(name)
  # end
  #
  # o.on("--trace options",String,"Set log level (default INFO, see bio-logger)") do | s |
  #   Bio::Log::CLI.trace(s)
  # end
  # 
  # o.on("-q", "--quiet", "Run quietly") do |q|
  #   Bio::Log::CLI.trace('error')
  # end
  # 
  # o.on("-v", "--verbose", "Run verbosely") do |v|
  #   Bio::Log::CLI.trace('info')
  # end
  # 
  # o.on("--debug", "Show debug messages") do |v|
  #   Bio::Log::CLI.trace('debug')
  # end

  o.separator ""
  o.on_tail('-h', '--help', 'display this help and exit') do
    options[:show_help] = true
  end
end

begin
  opts.parse!(ARGV)

  # Uncomment the following when using the bio-logger 
  # Bio::Log::CLI.configure('<%= project_name %>')

  # TODO: your code here
  # use options for your logic
rescue OptionParser::InvalidOption => e
  options[:invalid_argument] = e.message
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bio-gem-1.3.4 lib/bio-gem/templates/bin/bio-plugin
bio-gem-1.3.3 lib/bio-gem/templates/bin/bio-plugin
bio-gem-1.3.2 lib/bio-gem/templates/bin/bio-plugin
bio-gem-1.3.1 lib/bio-gem/templates/bin/bio-plugin
bio-gem-1.3.0 lib/bio-gem/templates/bin/bio-plugin
bio-gem-1.2.2 lib/bio-gem/templates/bin/bio-plugin