From 0f73158ed887b7ae501f0fa868872b506299770f Mon Sep 17 00:00:00 2001 From: Eivind Uggedal Date: Thu, 18 Sep 2014 19:44:31 +0000 Subject: [PATCH] data/xbps.bash: shorten argument comparisons --- data/xbps.bash | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/data/xbps.bash b/data/xbps.bash index 6d00621a..4dd03163 100644 --- a/data/xbps.bash +++ b/data/xbps.bash @@ -38,8 +38,8 @@ _xbps_complete() { return fi - local common='-C|--config|-r|--rootdir' - local morecommon="$common|-c|--cachedir" + local common='C|-config|r|-rootdir' + local morecommon="$common|c|-cachedir" local modes='auto manual hold unhold' local props='architecture @@ -75,45 +75,45 @@ _xbps_complete() { case $1 in xbps-dgraph) - if [[ $prev != @(-c|-o|-r) ]]; then + if [[ $prev != -@(c|o|r) ]]; then _xbps_installed_reply $cur return fi ;; xbps-install) - if [[ $prev != @($morecommon) ]]; then + if [[ $prev != -@($morecommon) ]]; then _xbps_all_reply $cur return fi ;; xbps-pkgdb) - if [[ $prev == @(-m|--mode) ]]; then + if [[ $prev == -@(m|-mode) ]]; then COMPREPLY=( $( compgen -W "$modes" -- "$cur") ) return fi - if [[ $prev != @($common) ]]; then + if [[ $prev != -@($common) ]]; then _xbps_installed_reply $cur return fi ;; xbps-query) - if [[ $prev == @(-p|--property) ]]; then + if [[ $prev == -@(p|-property) ]]; then COMPREPLY=( $( compgen -W "$props" -- "$cur") ) return fi - if [[ $prev != @($morecommon|-p|--property|-o|--ownedby) ]]; then + if [[ $prev != -@($morecommon|o|-ownedby) ]]; then _xbps_all_reply $cur return fi ;; xbps-reconfigure) - if [[ $prev != @($common) ]]; then + if [[ $prev != -@($common) ]]; then _xbps_installed_reply $cur return fi ;; xbps-remove) - if [[ $prev != @($morecommon) ]]; then + if [[ $prev != -@($morecommon) ]]; then _xbps_installed_reply $cur return fi