Skip to content

Able to access options set by global_option() outside of the command block #7

@ggilder

Description

@ggilder

From @pruan-rht on February 16, 2015 18:0

Sometime, it's useful to be able to access options that at set in the global_option() be accessible outside of the command block so that I can do initialization of codes that are global to all sub commands. For example

global_option('-p', '--plan_id PLAN_ID_OR_NAME', 'specify the plan name or plan id')

command :rename do |c|
...
c.action do |arg, options|
...

I want to check the option plan_id outside of the c.action block for the various commands that this global_option applies to

Copied from original issue: tj/commander#94

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions