about summary refs log tree commit diff
path: root/xq
diff options
context:
space:
mode:
Diffstat (limited to 'xq')
-rwxr-xr-xxq12
1 files changed, 9 insertions, 3 deletions
diff --git a/xq b/xq
index 29a1b48..e3db2b9 100755
--- a/xq
+++ b/xq
@@ -1,5 +1,5 @@
 #!/bin/sh
-# xq PKGS... - query information about XBPS package
+# xq [-R] PKGS... - query information about XBPS package
 
 rmcol() {
 	sed 's/\x1b\[[0-9;]*[mG]//g'
@@ -14,12 +14,18 @@ ADDREPO="--repository=hostdir/binpkgs/$BRANCH
 	--repository=../hostdir/binpkgs/$BRANCH
 	--repository=../../hostdir/binpkgs/$BRANCH"
 
+R=
+if [ $1 = -R ]; then
+	R=-R
+	shift
+fi
+
 for pkg; do
 	xbps-query $ADDREPO -S "$pkg" | rmcol |
 		totop short_desc |
 		totop pkgver
-	xbps-query $ADDREPO -x "$pkg" | sed 's/^/	/;1s/^/depends:\n/'
-	REVDEP=$(xbps-query -X "$pkg" | sed 's/^/	/' )
+	xbps-query $ADDREPO $R -x "$pkg" | sed 's/^/	/;1s/^/depends:\n/'
+	REVDEP=$(xbps-query $R -X "$pkg" | sed 's/^/	/' )
 	if [ "$REVDEP" ]; then
 		printf "%s\n" "required-by:" "$REVDEP"
 	fi