Sha256: 5b5483ee8b710ae4595392762aa5f3f32f6920a0e2d77b5da808684536e5a00a

Contents?: true

Size: 1.98 KB

Versions: 10

Compression:

Stored size: 1.98 KB

Contents

#!/usr/bin/env ruby
#
# BioRuby <%= project_name %> Plugin
# Version 0.0.0 
# Author:: <%= user_name %>
# Copyright:: <%= Time.now.year %>
# License:: The Ruby License

 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

10 entries across 10 versions & 1 rubygems

Version Path
bio-gem-1.2.1 lib/bio-gem/templates/bin
bio-gem-1.2.0 lib/bio-gem/templates/bin
bio-gem-1.1.2 lib/bio-gem/templates/bin
bio-gem-1.1.1 lib/bio-gem/templates/bin
bio-gem-1.1.0 lib/bio-gem/templates/bin
bio-gem-1.0.0 lib/bio-gem/templates/bin
bio-gem-0.3.2 lib/bio-gem/templates/bin
bio-gem-0.3.1 lib/bio-gem/templates/bin
bio-gem-0.3.0 lib/bio-gem/templates/bin
bio-gem-0.2.2 lib/bio-gem/templates/bin