Module: OptparseLite::ServiceModuleSingleton

Includes:
ServiceClass, ServiceObject
Defined in:
lib/optparse-lite.rb

Instance Attribute Summary

Attributes included from ServiceClass

#spec, #ui

Instance Method Summary collapse

Methods included from ServiceObject

#init_service_object, #subcommand_dispatch

Methods included from HelpHelper

#cmd, #hdr, #help_requested?, #looks_like_header?, #prefix, #txt

Methods included from ServiceClass

#init_service_class, #method_added, #o, #opts, #set_argv_hook, #subcommands, #x

Instance Method Details

#init_service_module_singletonObject



565
566
567
# File 'lib/optparse-lite.rb', line 565

def init_service_module_singleton
  @dispatcher = Dispatcher.new(self, @spec, @ui)
end

#run(argv = ARGV) ⇒ Object



568
569
570
571
572
573
# File 'lib/optparse-lite.rb', line 568

def run argv=ARGV
  argv = argv.dup # never change caller's array
  return @ui.err.puts('run disabled. (probably for gentesting)') unless
    OptparseLite.run_enabled?
  @dispatcher.run argv
end