]> pd.if.org Git - zpackage/commitdiff
add sql filter option to list
authorNathan Wagner <nw@hydaspes.if.org>
Sat, 15 Dec 2018 16:06:59 +0000 (16:06 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Sat, 15 Dec 2018 16:06:59 +0000 (16:06 +0000)
zpm-list

index c10ace4ec1028b641fa25b95c3a022f89d5b8e4f..7ea697bf1e04ae1323dd33b373f3e9a04d561fca 100755 (executable)
--- a/zpm-list
+++ b/zpm-list
@@ -6,7 +6,7 @@ verbose=0
 nameonly=0
 latestonly=1
 
-while getopts :s:f:vnI opt; do
+while getopts :s:f:vnIF: opt; do
        case $opt in
                f) pkgfile="$OPTARG" ;;
                s) status="$OPTARG" ;;
@@ -14,6 +14,7 @@ while getopts :s:f:vnI opt; do
                v) verbose=1 ;;
                n) nameonly=1 ;;
                a) latestonly=0 ;;
+               F) filter="$OPTARG" ;;
        esac
 done
 shift $(( OPTIND - 1))
@@ -40,6 +41,10 @@ if [ -n "$status" ]; then
        where="and status = '$status'"
 fi
 
+if [ -n "$filter" ]; then
+       where="$where and ($filter)"
+fi
+
 pkgid=$1
 
 if [ -n "$pkgid" ]; then