pkgfile=${ZPMDB:-/var/lib/zpm/local.db}
-while getopts f:t:a:T:ijv opt; do
+order=asc
+
+while getopts f:t:a:T:ijvr opt; do
case $opt in
f) pkgfile="$OPTARG" ;;
t) target="$OPTARG" ;;
i) op=insert ;;
j) json=1 ;;
v) verbose=1 ;;
+ r) order=desc ;;
*) printf '%s unknown option %s\n' "$0" "$opt" ; exit 1 ;;
esac
done
if [ -n "$target" ]; then
printf "target like '%s' and " "$target"
fi
- printf "true order by ts;\n"
+ printf "true order by ts $order;\n"
} | zpm shell $pkgfile
fi