Method: ALib::MainModule::InstanceMethods#run

Defined in:
lib/alib.rb,
lib/alib-0.3.1.rb

#runObject



2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
# File 'lib/alib.rb', line 2352

def run
#--{{{
  logcatch do
    begin
      pre_run
      pre_parse_options
      parse_options
      post_parse_options
      if(@options.has_key?('help') or (@argv.size == 1 and @argv.first =~ %r/help/i))
        usage STDOUT
        exit EXIT_SUCCESS
      end
      pre_parse_argv
      parse_argv
      post_parse_argv
      init_logging
      pre_main
      status = main
      post_main
      post_run
      exit(status ? EXIT_SUCCESS : EXIT_FAILURE)
    rescue Errno::EPIPE
      STDOUT.tty? ?  raise : exit(EXIT_FAILURE)
    end
  end
#--}}}
end