Module: Parser
- Defined in:
- lib/tasks/helpers/parser.rb
Overview
Usage of names arguments in Rake as shown here: www.mikeball.us/blog/rake-option-parser/
Instance Method Summary collapse
Instance Method Details
#parse_options(command) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/tasks/helpers/parser.rb', line 5 def (command) = {} option_parser = OptionParser.new option_parser. = "Usage: rake #{command} [options]" case command when "mariadb_temporal_tables:gen_migration_application" setup_parser_for_gen_migration_application(option_parser, ) when "mariadb_temporal_tables:gen_migration_system" setup_parser_for_gen_migration_system(option_parser, ) else raise "Unable to parse options for unknown command: #{command}" end args = option_parser.order!(ARGV) {} option_parser.parse!(args) end |