Feature Requests: Browse | Submit New | Admin

[#7605] Give access to argument in action block

Date:
2007-01-05 20:58
Priority:
3
Submitted By:
Nobody
Assigned To:
Nobody (None)
Category:
Interface Improvements (example)
State:
Open
Summary:
Give access to argument in action block

Detailed description
For example:

    option :minutes do
        short '-m'
        long '--minutes=MINUTES'
        desc 'Show entries within the specified last MINUTES'
        action { env = env + "&minutes=" + :value }
    end

It's cleaner to do this one-time translation in the associated action code instead of later. At this point,
Choice.choices[:minutes] is not available.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-09-08 18:15
Sender: Sentinel K

You may use:
action do |value| do_something(value); end

Same as with filter.

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item