Skip to content

Commit

Permalink
Bugfix in clap.modes.Parser.addOption()
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Marecki committed Aug 2, 2013
1 parent 204b31b commit 21b6e07
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Changelog.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

----

#### Version 0.7.1 ():

* __fix__: fixed bug in `clap.modes.Parser().addOption()` (I forgot to port it to the new version of options)

#### Version 0.7.0 (2013-08-03):

**Warning**: this release is not backwards compatible, you'll need to port your software to it.
Expand Down
2 changes: 1 addition & 1 deletion clap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
from clap import parser
from clap import modes

__version__ = '0.7.0'
__version__ = '0.7.1'
9 changes: 3 additions & 6 deletions clap/modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def feed(self, argv):
self.parser = None
self.mode = ''

def addOption(self, short='', long='', argument=None, requires=[], needs=[], required=False, not_with=[], conflicts=[]):
def addOption(self, short='', long='', arguments=[], requires=[], needs=[], required=False, not_with=[], conflicts=[]):
"""Adds an option to the list of options recognized by parser.
Available types are: int, float and str.
If you `addOption` it is added to the general parser and all mode-parsers.
"""
new = option.Option(short=short, long=long, argument=argument,
new = option.Option(short=short, long=long, arguments=arguments,
requires=requires, needs=needs,
required=required, not_with=not_with,
conflicts=conflicts)
Expand Down Expand Up @@ -130,10 +130,7 @@ def get(self, s):
return self.parser.get(s)

def type(self, s):
"""Returns type of the option.
If mode is defined use self.parser.
If not, interate over all modes and return first non-None
type found.
"""Returns information about type(s) given option takes as its arguments.
"""
t = None
if self.parser: t = self.parser.type(s)
Expand Down

0 comments on commit 21b6e07

Please sign in to comment.