From: Nathan Wagner Date: Sat, 15 Dec 2018 16:06:59 +0000 (+0000) Subject: add sql filter option to list X-Git-Tag: v0.5.0~40 X-Git-Url: https://pd.if.org/git/?p=zpackage;a=commitdiff_plain;h=761aa1ed757b2fa53343f271abf984a56dba1cce add sql filter option to list --- diff --git a/zpm-list b/zpm-list index c10ace4..7ea697b 100755 --- 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