summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2008-12-04 14:20:24 +0100
committerDan McGee <dan@archlinux.org>2008-12-08 05:09:05 +0100
commitb373b1d16b6235bef2e34a9a21e043418222a813 (patch)
tree1bf45062665e60d58e30014259b3df2f995a7efd /contrib
parenta1f7c83dbf3bce492163362d2896e3a4176be616 (diff)
downloadpacman-b373b1d16b6235bef2e34a9a21e043418222a813.tar.gz
pacman-b373b1d16b6235bef2e34a9a21e043418222a813.tar.xz
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 <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/pactree3
1 files changed, 1 insertions, 2 deletions
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))