mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 07:48:50 -05:00
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>
This commit is contained in:
parent
a1f7c83dbf
commit
b373b1d16b
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user