Skip to content
This repository was archived by the owner on Sep 25, 2020. It is now read-only.
This repository was archived by the owner on Sep 25, 2020. It is now read-only.

Support for global options [moved] #10

@trentm

Description

@trentm

This is Issue 10 moved from a Google Code project.
Added by 2009-05-22T16:54:20.000Z by Sridhar....@gmail.com.
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Enhancement, Priority-High, Usability

Original description

To add global options, one can write code like this:

    def get_optparser(self):
        p = cmdln.Cmdln.get_optparser(self)
        p.add_option('-E', '--environment', dest='env',
                     help='path to virtualenv environment to use')
        p.set_defaults(env=None)
        return p

Wouldn't it be better to do this by using the same `@cmdln.option`
decorator but on the class itself rather than a method?

    @cmdln.option('-E', '--environment',  ...)
    class Foo(cmdln.Cmdln):
        ...

Thoughts?

(this would affect issue 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions