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

Support for global options [moved] #10

Open
trentm opened this issue Sep 28, 2012 · 0 comments
Open

Support for global options [moved] #10

trentm opened this issue Sep 28, 2012 · 0 comments

Comments

@trentm
Copy link
Owner

trentm commented Sep 28, 2012

This is Issue 10 moved from a Google Code project.
Added by 2009-05-22T16:54:20.000Z by [email protected].
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)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant