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).
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
Create program main option.
-
#usageCommand ⇒ Object
Usage printout for command.
Methods inherited from Opt
[], #[], addOpt, #addOption, #addSubcmd, #apply, #applyConfig, #argById, #argByName, author, #check, #checkAlso, #checkMissing, #checkRule, #cmdline, configGet, configOverlay, configSet, current, default, #default, defaultOpt, each, #each, each_given, #each_given, error, #error, #errornl, #evalCheck, external, fatal, #fatal, findOpt, #findOpt, full, #givenCount, #givenSubcmd, #hasSwitchStyleDoc, main, #opt, #params, #parse, #prim?, progname, reset, setMain, #setOptionSubcmd, #setRuleCheck, setSubcmd, #setUsageFooter, #setUsageHeader, #suball, subcmd, #suboptDoc, #to_hash, #to_hopt, #usage, #usageIfHelp, #usageNormal, warn, #warn, year, #~
Methods inherited from ComoCommon
getIo, runHook, setHook, setIo
Constructor Details
#initialize(author, year, name, opt, type, doc, value = nil) ⇒ MainOpt
Create program main option.
2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 |
# File 'lib/como.rb', line 2114 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).
2110 2111 2112 |
# File 'lib/como.rb', line 2110 def @author end |
#external ⇒ Object
Program external arguments:
2107 2108 2109 |
# File 'lib/como.rb', line 2107 def external @external end |
#year ⇒ Object (readonly)
Program author and year (date).
2110 2111 2112 |
# File 'lib/como.rb', line 2110 def year @year end |
Instance Method Details
#fullCommand ⇒ Object
Full command name.
2128 2129 2130 |
# File 'lib/como.rb', line 2128 def fullCommand Opt.progname end |
#usageCommand ⇒ Object
Usage printout for command.
2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 |
# File 'lib/como.rb', line 2134 def usageCommand str = "\ #{fullCommand} #{cmdline.join(" ")} " str += suboptDoc if @config[ :copyright ] str += " Copyright (c) #{Opt.year} by #{Opt.} " end str end |