Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Task Options

#44

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.

Reported by bahuvrihi · May 20th, 2008 @ 12:41 AM

State: invalid
Milestone: none
Assigned to: bahuvrihi bahuvrihi

Activity

  1. bahuvrihi
    bahuvrihi
    • 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

    May 29th, 2008 @ 12:11 PM

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.