From ea88940b846e4399c749b10425d6c68e694eaee6 Mon Sep 17 00:00:00 2001 From: Eivind Uggedal Date: Mon, 15 Sep 2014 07:24:01 +0000 Subject: [PATCH] data/xbps.bash: add property completion. --- data/xbps.bash | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/data/xbps.bash b/data/xbps.bash index e60b7576..b1229bd6 100644 --- a/data/xbps.bash +++ b/data/xbps.bash @@ -41,6 +41,32 @@ _xbps_complete() { local common='-C|--config|-r|--rootdir' local morecommon="$common|-c|--cachedir" + local modes='auto manual hold unhold' + local props='architecture + automatic-install + build-date + build-options + conflicts + homepage + install-date + install-script + installed_size + license + maintainer + metafile-sha256 + packaged-with + pkgver + preserve + provides + remove-script + replaces + repository + shlib-provides + shlib-requires + short_desc + source-revisions + state' + case $1 in xbps-dgraph) if [[ $prev != @(-c|-o|-r) ]]; then @@ -56,7 +82,7 @@ _xbps_complete() { ;; xbps-pkgdb) if [[ $prev == @(-m|--mode) ]]; then - COMPREPLY=( $( compgen -W 'auto manual hold unhold' -- "$cur") ) + COMPREPLY=( $( compgen -W "$modes" -- "$cur") ) return fi if [[ $prev != @($common) ]]; then @@ -65,6 +91,10 @@ _xbps_complete() { fi ;; xbps-query) + if [[ $prev == @(-p|--property) ]]; then + COMPREPLY=( $( compgen -W "$props" -- "$cur") ) + return + fi if [[ $prev != @($morecommon|-p|--property|-o|--ownedby) ]]; then _xbps_all_reply $cur return