Class: ALib::MainModule::SimpleMain
- Inherits:
-
Object
- Object
- ALib::MainModule::SimpleMain
- Includes:
- Abilities
- Defined in:
- lib/alib.rb,
lib/alib-0.3.1.rb
Overview
–}}}
Class Method Summary collapse
Instance Method Summary collapse
-
#pre_parse_argv ⇒ Object
–}}}.
Methods included from Abilities
Class Method Details
.class_initialize ⇒ Object
–{{{
2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 |
# File 'lib/alib.rb', line 2578 def class_initialize #--{{{ version '0.0.0' prognam ALib::Util::prognam usage <<-usage NAME #{ prognam } v#{ version } SYNOPSIS #{ prognam } [options]+ [file]+ usage optspec [ [ '--help', '-h', 'this message' ], [ '--log=path','-l', 'set log file - (default stderr)' ], [ '--verbosity=verbostiy', '-v', '0|fatal < 1|error < 2|warn < 3|info < 4|debug - (default info)' ], =begin [ '--config=path', 'valid path - specify config file (default nil)' ], [ '--template=[path]', 'valid path - generate a template config file in path (default stdout)' ], =end ] #--}}} end |
Instance Method Details
#pre_parse_argv ⇒ Object
–}}}
2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 |
# File 'lib/alib.rb', line 2620 def pre_parse_argv #--{{{ if(@options.has_key?('help') or (@argv.size == 1 and @argv.first =~ %r/help/i)) usage STDOUT exit EXIT_SUCCESS end if(@options.has_key?('version') or @argv.first =~ %r/version/i) STDOUT.puts self.class.version exit EXIT_SUCCESS end #--}}} end |