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

generaltoption with extra arguments #125

Open
JensTimmerman opened this issue Jun 19, 2014 · 3 comments
Open

generaltoption with extra arguments #125

JensTimmerman opened this issue Jun 19, 2014 · 3 comments

Comments

@JensTimmerman
Copy link
Contributor

https://github.com/hpcugent/vsc-base/blob/master/lib/vsc/utils/generaloption.py#L974
shouldn't this be >0 ?

because now when using simple_option

bla x
gives me an optionparser.args == ['x']
but
bla x y
gives me the error in the next line.

@JensTimmerman
Copy link
Contributor Author

Also ALLOPTSMANDATORY seems like a misnomer, because if I want an optionparser that just gives me arguments, and needs no options (but gives me the logger and stuff) I need to do

from vsc.utils.generaloption import SimpleOption                                                                         

SimpleOption.ALLOPTSMANDATORY = False                                                                                    
go = SimpleOption(None, None, None, None, None)  

@stdweird
Copy link
Member

the >, yeah, that's a typo.
not sure i understand the second remark

$ python -c 'from vsc.utils.generaloption import SimpleOption;SimpleOption.ALLOPTSMANDATORY = False;go=SimpleOption();go.log.error(len(go.args))'
2014-06-19 14:45:31,998 ERROR      <string>.-C.__init__ MainThread  0

@JensTimmerman
Copy link
Contributor Author

the second remark is that
bla x y gives an error because args is not empty, and when setting ALLOPTSMANDATORY=False it does not.

so making opts non mandatory makes args possible, which is not really what you would expect.
and mandatory options are a contradiction, either they are optional, or they are mandatory :p

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

2 participants