Method: RProgram::Task.arguments

Defined in:
lib/rprogram/task.rb

.arguments(options = {}) {|task| ... } ⇒ Array

Creates a new Task object, then formats command-line arguments using the Task object.

Examples:

MyTask.arguments(:verbose => true, :count => 2)
# => [...]
MyTask.arguments do |task|
  task.verbose = true
  task.file = 'output.txt'
end
# => [...]

Parameters:

  • options (Hash{Symbol => Object}) (defaults to: {})

    Additional task options.

Yields:

  • (task)

    If a block is given, it will be passed the newly created task.

Yield Parameters:

  • task (Task)

    The newly created Task object.

Returns:

  • (Array)

    The formatted arguments from a Task object.



169
170
171
# File 'lib/rprogram/task.rb', line 169

def self.arguments(options={},&block)
  self.new(options,&block).arguments
end