Class: Como::MainOpt
- Inherits:
-
Opt
- Object
- ComoCommon
- Opt
- Como::MainOpt
- Defined in:
- lib/como.rb
Overview
Specialized Opt class for program (i.e. highest level subcommand).
Constant Summary
Constants inherited from ComoCommon
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Program author and year (date).
-
#external ⇒ Object
Program external arguments:.
-
#year ⇒ Object
readonly
Program author and year (date).
Attributes inherited from Opt
#config, #doc, #given, #longOpt, #name, #parent, #rules, #shortOpt, #subcmd, #subopt, #type, #value
Instance Method Summary collapse
-
#fullCommand ⇒ Object
Full command name.
-
#initialize(author, year, name, opt, type, doc, value = nil) ⇒ MainOpt
constructor
A new instance of MainOpt.
-
#usageCommand ⇒ Object
Usage printout for command.
Methods inherited from Opt
[], #[], addOpt, #apply, #applyConfig, #argById, #argByName, author, #check, #checkAlso, #checkMissing, #checkRule, #cmdline, configGet, configOverlay, configSet, current, default, #default, defaultOpt, #each, each, #each_given, each_given, #error, external, findOpt, #findOpt, full, #givenCount, #givenSubcmd, #hasArg, #hasMany, #isExclusive, #isRequired, #isSwitch, main, #opt, #params, #parse, progname, reset, setMain, #setRuleCheck, setSubcmd, #setSubopt, #setUsageFooter, #setUsageHeader, #silent?, #suball, subcmd, #suboptDoc, #usage, #usageIfHelp, #usageNormal, year, #~
Methods inherited from ComoCommon
getIo, runHook, setHook, setIo
Constructor Details
#initialize(author, year, name, opt, type, doc, value = nil) ⇒ MainOpt
Returns a new instance of MainOpt.
1856 1857 1858 1859 1860 1861 1862 1863 |
# File 'lib/como.rb', line 1856 def initialize( , year, name, opt, type, doc, value = nil ) @author = @year = year @external = nil super( name, opt, type, doc, value = nil ) end |
Instance Attribute Details
#author ⇒ Object (readonly)
Program author and year (date).
1853 1854 1855 |
# File 'lib/como.rb', line 1853 def @author end |
#external ⇒ Object
Program external arguments:
1850 1851 1852 |
# File 'lib/como.rb', line 1850 def external @external end |
#year ⇒ Object (readonly)
Program author and year (date).
1853 1854 1855 |
# File 'lib/como.rb', line 1853 def year @year end |
Instance Method Details
#fullCommand ⇒ Object
Full command name.
1867 1868 1869 |
# File 'lib/como.rb', line 1867 def fullCommand Opt.progname end |
#usageCommand ⇒ Object
Usage printout for command.
1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 |
# File 'lib/como.rb', line 1873 def usageCommand str = "\ #{fullCommand} #{cmdline.join(" ")} " str += suboptDoc if @config[ :copyright ] str += " Copyright (c) #{Opt.year} by #{Opt.} " end str end |