From 761aa1ed757b2fa53343f271abf984a56dba1cce Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Sat, 15 Dec 2018 16:06:59 +0000 Subject: [PATCH] add sql filter option to list --- zpm-list | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.40.0