Method: Ing::Task.specify_options
- Defined in:
- lib/ing/task.rb
.specify_options(parser) ⇒ Object
Build option parser based on desc, usage, and options (including inherited options). This method is called by ‘Ing::Command`. Note that this assumes the syntax of the Trollop parser.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/ing/task.rb', line 76 def (parser) desc_lines.each do |line| parser.text line end unless usage_lines.empty? parser.text "\nUsage:" usage_lines.each do |line| parser.text line end end unless .empty? parser.text "\nOptions:" .each do |name, opt| parser.opt *opt.to_args end end unless .empty? parser.text "\nCommon Options:" .each do |name, opt| parser.opt *opt.to_args end end end |