Module: CommandLine
- Defined in:
- lib/ejt_command_line.rb
Overview
Defined Under Namespace
Classes: Command, CommandLineError, ConfigureError, ParseError, Parser, Switch
Instance Method Summary collapse
-
#bracket_(release) ⇒ Object
from prelude.
-
#simple_switch_parser(*aliases) ⇒ Object
—————————————————————-.
- #value_switch_parser(*aliases, &block) ⇒ Object
Instance Method Details
#bracket_(release) ⇒ Object
from prelude
8 9 10 11 12 13 14 15 16 |
# File 'lib/ejt_command_line.rb', line 8 def bracket_(release) r = nil begin r = yield ensure release.call end r end |
#simple_switch_parser(*aliases) ⇒ Object
31 32 33 |
# File 'lib/ejt_command_line.rb', line 31 def simple_switch_parser(*aliases) ArrayParser::choice(*aliases) end |
#value_switch_parser(*aliases, &block) ⇒ Object
35 36 37 |
# File 'lib/ejt_command_line.rb', line 35 def value_switch_parser(*aliases, &block) p = sequence(choice(*aliases), value(&block)) end |