Class: Como::MainOpt

Inherits:
Opt show all
Defined in:
lib/como.rb

Overview

Specialized Opt class for program (i.e. highest level subcommand).

Instance Attribute Summary (collapse)

Attributes inherited from Opt

#config, #doc, #given, #longOpt, #name, #opt, #parent, #rules, #silent, #subcmd, #subopt, #type, #value

Instance Method Summary (collapse)

Methods inherited from Opt

[], #[], addOpt, #apply, #applyConfig, #argById, #argByName, author, #check, #checkAlso, #checkMissing, #checkRule, #cmdline, configOverlay, current, #default, default, defaultOpt, each, #each, each_given, #each_given, #error, exclusive, external, findOpt, #findOpt, full, #givenCount, #givenSubcmd, #hasArg, #hasMany, #isRequired, #isSwitch, main, #params, #parse, progname, reset, setMain, #setRuleCheck, setSubcmd, #setSubopt, #setUsageFooter, #setUsageHeader, #silent?, #suball, subcmd, #suboptDoc, switch, #usage, #usageIfHelp, #usageNormal, year, #~

Methods inherited from ComoCommon

getIo, setIo

Constructor Details

- (MainOpt) initialize(author, year, name, opt, type, doc, value = nil)

A new instance of MainOpt



1739
1740
1741
1742
1743
1744
1745
1746
# File 'lib/como.rb', line 1739

def initialize( author, year,
                name, opt, type, doc, value = nil )
    @author = author
    @year = year
    @external = nil
    super( name, opt, type, doc, value = nil )

end

Instance Attribute Details

- (Object) author (readonly)

Program author and year (date).



1736
1737
1738
# File 'lib/como.rb', line 1736

def author
  @author
end

- (Object) external

Program external arguments:



1733
1734
1735
# File 'lib/como.rb', line 1733

def external
  @external
end

- (Object) year (readonly)

Program author and year (date).



1736
1737
1738
# File 'lib/como.rb', line 1736

def year
  @year
end

Instance Method Details

- (Object) fullCommand

Full command name.



1750
1751
1752
# File 'lib/como.rb', line 1750

def fullCommand
    Opt.progname
end

- (Object) usageCommand

Usage printout for command.



1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
# File 'lib/como.rb', line 1756

def usageCommand
    str = "
  Usage:
    #{fullCommand} #{cmdline.join(" ")}

"
    str += suboptDoc

    str += "

  Copyright (c) #{Opt.year} by #{Opt.author}

"
end