Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug and Design Flaw: Option "--opts" clashes with Command#opts function #334

Closed
mwittig opened this issue Jan 26, 2015 · 4 comments
Closed

Comments

@mwittig
Copy link

mwittig commented Jan 26, 2015

I think it is a major weakness of the commander design that the parse result is simply added to the Command object which itself contains functions members like opts(). This way, it will not be possible to use an option like

program.options("--opts [value]", "Decription");

as the parse result, i.e., "program.opts" does not refer to the option value but to the opts function of the Command object.

Possible solutions:

  1. Let Command contain an result object where parse results are stored.
    or
  2. Rename Command functions to be less harmful, e.g. use underscore prefix

Well, there may also be other solutions. Please also advise if the there is a better way of using the API. I have just followed the given examples to familarize myself with the commander API.

@SomeKittens
Copy link
Collaborator

This is a known issue, and a big one. Unfortunately, us maintainers are all volunteers and don't have the free time we'd like to fix things. We're working on a plugin system but that's a long time coming.

@mwittig
Copy link
Author

mwittig commented Jan 27, 2015

I am happy to help on the project, but I don't understand why you close the issue as it has not been solved. As there some, similar issues raised why don't you group than as one Bug issue?

@onury
Copy link

onury commented Oct 30, 2016

This is not right. You should keep this open if it's not resolved.

@shadowspawn
Copy link
Collaborator

Added to triage item: #933
There is a work-around now: program.storeOptionsAsProperties(false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants