Class: SubCmdOptParser::OptionParserForSubCmd

Inherits:
OptionParser
  • Object
show all
Defined in:
lib/subcommand_optparse.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#subcommand_nameObject

Returns the value of attribute subcommand_name.



7
8
9
# File 'lib/subcommand_optparse.rb', line 7

def subcommand_name
  @subcommand_name
end

Instance Method Details



9
10
11
12
13
14
15
# File 'lib/subcommand_optparse.rb', line 9

def banner
  unless @banner
    @banner = "Usage: #{program_name} #{@subcommand_name || '<command>'} [options]"
    visit(:add_banner, @banner)
  end
  @banner
end