Support ranges in task filter
This commit is contained in:
parent
163778e845
commit
3a18ea30cb
22
t.sh
22
t.sh
|
@ -1630,8 +1630,17 @@ elif [[ $mode == "right" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while [[ $# -gt 1 ]]; do
|
while [[ $# -gt 1 ]]; do
|
||||||
|
if [[ $1 =~ ^[0-9]+-[0-9]+$ ]]; then
|
||||||
|
s=${1%-*}
|
||||||
|
e=${1#*-}
|
||||||
|
for ((w2=s; w2<=e; w2++)); do
|
||||||
|
uid=$(getuid_witherror $w2)
|
||||||
|
move_right $uid $puid
|
||||||
|
done
|
||||||
|
else
|
||||||
uid=$(getuid_witherror $1)
|
uid=$(getuid_witherror $1)
|
||||||
move_right $uid $puid
|
move_right $uid $puid
|
||||||
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
elif [[ $mode == "view" ]]; then
|
elif [[ $mode == "view" ]]; then
|
||||||
|
@ -1723,12 +1732,21 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
elif [[ $filter =~ ^[0-9\ ]+$ ]]; then
|
elif [[ $filter =~ ^[0-9\ \-]+$ ]]; then
|
||||||
# list of task IDs
|
# list of task IDs
|
||||||
for wantid in $filter; do
|
for wantid in $filter; do
|
||||||
uids="$uids ${taskuid[$wantid]}"
|
if [[ $wantid =~ ^[0-9]+-[0-9]+$ ]]; then
|
||||||
|
s=${wantid%-*}
|
||||||
|
e=${wantid#*-}
|
||||||
|
for ((w2=s; w2<=e; w2++)); do
|
||||||
|
uids="$uids ${taskuid[$w2]}"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
uids="$uids ${taskuid[$wantid]}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "GOT TEXT" >/dev/stderr
|
||||||
# text to match
|
# text to match
|
||||||
a=$( echo ${filter} | tr 'A-Z' 'a-z')
|
a=$( echo ${filter} | tr 'A-Z' 'a-z')
|
||||||
for id in ${!taskid[@]}; do
|
for id in ${!taskid[@]}; do
|
||||||
|
|
Loading…
Reference in New Issue