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, #errornl, external, #fatal, findOpt, #findOpt, full, #givenCount, #givenSubcmd, #hasArg, #hasMany, #isExclusive, #isRequired, #isSwitch, main, #opt, #params, #parse, progname, reset, setMain, #setOptionSubcmd, #setRuleCheck, setSubcmd, #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
Create program main option.
1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 |
# File 'lib/como.rb', line 1958 def initialize( , year, name, opt, type, doc, value = nil ) = @year = year @external = nil super( name, opt, type, doc, value = nil ) end |
Instance Attribute Details
#author ⇒ Object (readonly)
Program author and year (date).
1954 1955 1956 |
# File 'lib/como.rb', line 1954 def end |
#external ⇒ Object
Program external arguments:
1951 1952 1953 |
# File 'lib/como.rb', line 1951 def external @external end |
#year ⇒ Object (readonly)
Program author and year (date).
1954 1955 1956 |
# File 'lib/como.rb', line 1954 def year @year end |
Instance Method Details
#fullCommand ⇒ Object
Full command name.
1972 1973 1974 |
# File 'lib/como.rb', line 1972 def fullCommand Opt.progname end |
#usageCommand ⇒ Object
Usage printout for command.
1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 |
# File 'lib/como.rb', line 1978 def usageCommand str = "\ #{fullCommand} #{cmdline.join(" ")} " str += suboptDoc if @config[ :copyright ] str += " Copyright (c) #{Opt.year} by #{Opt.author} " end str end |