New xbps-query wrapper xqn, searches name only

This commit is contained in:
crater2150 2019-02-11 15:32:03 +01:00
parent 24bede8c5c
commit 4af5440511

View file

@ -3,6 +3,16 @@
grep -q "void" /etc/os-release || return grep -q "void" /etc/os-release || return
alias xq="xbps-query -Rs" alias xq="xbps-query -Rs"
xqn() {
if [[ -z $1 || -n $2 ]]; then
<<-HERE
Usage: xqn NAME
Search for NAME only in package names
HERE
else
xbps-query -Rs $1 | awk "\$2 ~ /$1/ { print }"
fi
}
alias xfiles="xbps-query -f" alias xfiles="xbps-query -f"