From b373b1d16b6235bef2e34a9a21e043418222a813 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Thu, 4 Dec 2008 23:20:24 +1000 Subject: contrib/pactree: fix option parsing The option parsing was catching any "-d" in an argument so packages with this in their name did not work. Also removed commented code line that appears to be inserted during testing. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- contrib/pactree | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/pactree b/contrib/pactree index d9fa8b3b..df536717 100755 --- a/contrib/pactree +++ b/contrib/pactree @@ -208,11 +208,10 @@ for (( n=0 ; n < $len_options ; n++ )); do continue fi - if [[ "${options[$n]}" =~ -d[[:digit:]]* || "${options[$n]}" == "--depth" ]]; then + if [[ "${options[$n]}" =~ -d[[:digit:]]+ || "${options[$n]}" == "--depth" ]]; then if [[ "${options[$n]#-d}" =~ [[:digit:]]+ ]]; then max_depth="${options[$n]#-d}" elif [[ ${options[$((n+1))]} =~ [[:digit:]]+ ]]; then -# if [ ${options[$((n+1))]} -eq ${options[$((n+1))]} 2>/dev/null ]; then max_depth="${options[$((n+1))]}" unset options[$((n+1))] ((++n)) -- cgit v1.2.3-24-g4f1b