Class: Convertr::Runner::OptParser
- Inherits:
-
Object
- Object
- Convertr::Runner::OptParser
- Defined in:
- lib/convertr/runner.rb
Overview
{{{
Class Method Summary collapse
Class Method Details
.parse(args) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/convertr/runner.rb', line 6 def self.parse(args) = Convertr::Config.instance .db_config_file = "~/.convertr/database.yml" .settings_file = "~/.convertr/settings.yml" .max_tasks = 0 opts = OptionParser.new do |opts| opts. = "Usage: convertr [options]" opts.separator "" opts.separator "Specific options:" opts.on("-d", "--db_config_file [PATH_TO_DB_CONFIG]", "Specify path to database.yml file") do |dbc| .db_config_file = dbc end opts.on("-c", "--settings_file [PATH_TO_CONFIG]", "Specify path to settings.yml file") do |c| .settings_file = c end opts.on("-m", "--max_tasks N", Integer, "Specify the maximum tasks to complete") do |m| .max_tasks = m end end opts.parse!(args) end |