Class Arguments
In: lib/tj3man.rb
Parent: Object

Methods

new  

Attributes

directory  [R] 
keywords  [R] 
manual  [R] 

Public Class methods

[Source]

# File lib/tj3man.rb, line 26
  def initialize(argv)
    @keywords = []
    @directory = './'
    @manual = false

    opts = OptionParser.new
    opts.banner = "#{AppConfig.softwareName} v#{AppConfig.version} - " +
                  "#{AppConfig.packageInfo}\n\n" +
                  "Copyright (c) #{AppConfig.copyright.join(', ')}\n" +
                  "              by #{AppConfig.authors.join(', ')}\n\n" +
                  "#{AppConfig.license}\n" +
                  "For more info about #{AppConfig.softwareName} see " +
                  "#{AppConfig.contact}\n"
    opts.separator ''
    opts.separator "Usage: #{AppConfig.appName} [options] [<keyword> ...]"
    opts.separator 'Options:'

    opts.on('-d', '--dir <directory>', String,
            'directory to put the manual') do |dir|
      @directory = dir
    end
    opts.on('-m', '--manual',
            'Generate the user manual into the current directory or ' +
            'the directory specified with the -d option.') do
      @manual = true
    end
    opts.on_tail('-h', '--help', 'Show this message.') do
      puts opts
      exit
    end
    opts.on_tail('--version', 'Show version number.') do
      puts opts.banner
      exit
    end

    @keywords = opts.parse(argv)
  end

[Validate]