Task Options
Reported by bahuvrihi | May 20th, 2008 @ 12:41 AM
OptionParser
//on tail
properties = {
:arg => # [:mandatory, :optional, :switch, list, [] indicating selection]
:cast => # Class
:block => # perform something novel... by default the block simply sets config with result. }
Converting to properties
no cast:
default indicated by &type.
then no arg, for cast:
Bloolean => switch
Array => list
Error if list and cast to something other than Array?
type: string, boolean, float, integer, array, selection (in?), yaml
Usage
Pickup documentation from RDoc... no help messages specified ( add later ? )
Evaluate options in context with: config, argv, option class
API
opt defines option properties, no actual config. Block, same as above. Non-configs are simply passed into task.config and stored.
Need an class_options class to hold this information. Should be separate from ClassConfiguration as they apply in different contexts.
Comments and changes to this ticket
-
bahuvrihi May 29th, 2008 @ 12:11 PM
- State changed from new to invalid
- Assigned user set to bahuvrihi
Tests have shown that options are not a good idea. The main isssue is that there is no way to set a proper context for the option block. This resulted in problems during inheritance as well as simply getting access to the active OptionParser for printing help.
See commit ea2c49ee679f5ac323b90bcf954f9a2917923964
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A framework for making configurable, file-based tasks and workflows.