From 0c6d2b1131db0c4b477d52b935ff6a7f52084a3c Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Sat, 3 Nov 2018 12:17:03 +0000 Subject: [PATCH] add options to control config file listing --- zpm-contents | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zpm-contents b/zpm-contents index 8b7dde0..6bc470e 100755 --- a/zpm-contents +++ b/zpm-contents @@ -5,13 +5,16 @@ pkgfile=${ZPMDB:-/var/lib/zpm/db.zpm} long=0 pkgonly=0 quiet=0 +config=include -while getopts f:qln opt; do +while getopts f:qlncC opt; do case $opt in f) pkgfile="$OPTARG" ;; l) long=1 ;; n) pkgonly=1 ;; q) quiet=1 ;; + c) config=only ;; + C) config=exclude ;; esac done shift $((OPTIND - 1)) @@ -79,6 +82,10 @@ cols=${cols%,} if [ -n "$pkglist" ]; then printf "and pkgid in (%s)\n" "$pkglist" fi + case $config in + only) printf "and configuration = 1\n" ;; + exclude) printf "and configuration = 0\n" ;; + esac printf 'order by pkgid,path\n' printf ';\n' } | zpm shell $pkgfile -- 2.40.0