aboutsummaryrefslogtreecommitdiffstats
path: root/src/test.bash
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-08-26 13:21:30 +0200
committerMattias Andrée <maandree@operamail.com>2013-08-26 13:21:30 +0200
commite73228aaafce7901a6a39cf4ce6dbfdbf8f0a6b2 (patch)
treee953538a8ff426089f2955918824509d558fe84f /src/test.bash
parentissue 2, info manual (diff)
downloadargparser-e73228aaafce7901a6a39cf4ce6dbfdbf8f0a6b2.tar.gz
argparser-e73228aaafce7901a6a39cf4ce6dbfdbf8f0a6b2.tar.bz2
argparser-e73228aaafce7901a6a39cf4ce6dbfdbf8f0a6b2.tar.xz
update test
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/test.bash')
-rwxr-xr-xsrc/test.bash13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/test.bash b/src/test.bash
index 136439c..71e6137 100755
--- a/src/test.bash
+++ b/src/test.bash
@@ -49,8 +49,9 @@ args_add_argumentless '' 0 'Prints this help message\n(and exits)' -h -? --he
args_add_argumentless '' 0 'Prints the text: hello world' --hello
args_add_argumentless '' 0 '' ++hidden
-args_add_argumented '' 0 LINE 'Prints the choosen line' -l --line
-args_add_variadic '' 0 LINE 'Prints the choosen lines' --l --lines
+args_add_argumented '' 0 LINE 'Prints the choosen line' -l --line
+args_add_optargumented '' '' 0 LINE 'Prints the choosen line' -l --Line
+args_add_variadic '' 0 LINE 'Prints the choosen lines' --l --lines
args_parse "$@"
args_support_alternatives
@@ -74,6 +75,14 @@ elif [ $args_unrecognised_count = 0 ] && [ ! $args_argcount = 0 ] && [ ${#args_f
(( i++ ))
done
fi
+ if args_option has -L; then
+ i=0
+ n=$(args_option count --Line)
+ while (( $i < $n )); do
+ args_option get --Line $i
+ (( i++ ))
+ done
+ fi
if args_option has --lines; then
i=0
n=$(args_option count --l)