aboutsummaryrefslogtreecommitdiffstats
path: root/src/test.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-08-23 20:40:29 +0200
committerMattias Andrée <maandree@operamail.com>2013-08-23 20:40:29 +0200
commit9486172464454e4ad397b7a94a480ebec1d4a216 (patch)
tree159d28772ee4708affc7de6830ca29444c1dea4c /src/test.py
parentupdate pkgbuild (diff)
downloadargparser-9486172464454e4ad397b7a94a480ebec1d4a216.tar.gz
argparser-9486172464454e4ad397b7a94a480ebec1d4a216.tar.bz2
argparser-9486172464454e4ad397b7a94a480ebec1d4a216.tar.xz
issue 2, python version
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rwxr-xr-xsrc/test.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test.py b/src/test.py
index cd3b2ad..26e9ff3 100755
--- a/src/test.py
+++ b/src/test.py
@@ -44,6 +44,7 @@ parser.add_argumentless(['--hello'], 0, 'Prints the text: hello world')
parser.add_argumentless(['++hidden'], 0)
parser.add_argumented(['-l', '--line'], 0, 'LINE', 'Prints the choosen line')
+parser.add_optargumented(['-L', '--Line'], 0, 'LINE', 'Prints the choosen line')
parser.add_variadic(['--l', '--lines'], 0, 'LINE', 'Prints the choosen lines')
parser.parse()
@@ -58,6 +59,9 @@ elif parser.unrecognisedCount == 0 and len(parser.arguments) > 0 and len(parser.
if parser.opts['-l'] is not None:
for line in parser.opts['--line']:
print(line)
+ if parser.opts['-L'] is not None:
+ for line in parser.opts['--Line']:
+ print(line)
if parser.opts['--lines'] is not None:
for line in parser.opts['--l']:
print(str(line))