[pacman-dev] [PATCH 1/2] bash_completion: update makepkg completion
Signed-off-by: Allan McRae <allan@archlinux.org> --- contrib/bash_completion.in | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/contrib/bash_completion.in b/contrib/bash_completion.in index 224b8f9..c74106f 100644 --- a/contrib/bash_completion.in +++ b/contrib/bash_completion.in @@ -74,12 +74,13 @@ _makepkg() { local cur opts prev COMPREPLY=() _get_comp_words_by_ref cur prev - if [[ $cur = -* && ! $prev =~ ^-(-(config|help)$|\w*[Chp]) ]]; then - opts=('allsource asdeps check clean config force geninteg help holdver ignorearch install - key log needed noarchive nobuild nocheck nocolor noconfirm nodeps noextract noprepare - noprogressbar nosign pkg repackage rmdeps sign skipchecksums skipinteg skippgpcheck - source syncdeps verifysource version' - 'A L R S c d e f g h i m o p r s') + if [[ $cur = -* && ! $prev =~ ^-(-(config|help|key|version)$|\w*[Vhp]) ]]; then + opts=('allsource asdeps check clean cleanbuild config force geninteg help + holdver ignorearch install key log needed noarchive nobuild nocheck + nocolor noconfirm nodeps noextract noprepare noprogressbar nosign + packagelist printsrcinfo repackage rmdeps sign skipchecksums + skipinteg skippgpcheck source syncdeps verifysource version' + 'A C L R S c d e f g h i m o p r s') _arch_ptr2comp opts fi true -- 2.7.0
Signed-off-by: Allan McRae <allan@archlinux.org> --- I have no idea if the F) case does what is needed... Can someone test this for me? contrib/bash_completion.in | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/contrib/bash_completion.in b/contrib/bash_completion.in index c74106f..d96865d 100644 --- a/contrib/bash_completion.in +++ b/contrib/bash_completion.in @@ -101,6 +101,7 @@ _pacman() { COMPREPLY=() _get_comp_words_by_ref cur prev database=('asdeps asexplicit') + files=('list machinereadable owns search refresh regex' 'l o s x y') query=('changelog check deps explicit file foreign groups info list owns search unrequired upgrades' 'c e g i k l m o p s t u') remove=('cascade dbonly nodeps assume-installed nosave print recursive unneeded' 'c n p s u') @@ -108,23 +109,26 @@ _pacman() { info list needed nodeps assume-installed print refresh recursive search sysupgrade' 'c g i l p s u w y') upgrade=('asdeps asexplicit force needed nodeps assume-installed print recursive' 'p') - common=('arch cachedir color config dbpath debug help logfile noconfirm - noprogressbar noscriptlet quiet root verbose' 'b d h q r v') - core=('database help query remove sync upgrade version' 'D Q R S U V h') + common=('arch cachedir color config confirm dbpath debug gpgdir help hookdir logfile + noconfirm noprogressbar noscriptlet quiet root verbose' 'b d h q r v') + core=('database files help query remove sync upgrade version' 'D F Q R S U V h') - for o in 'D database' 'Q query' 'R remove' 'S sync' 'U upgrade'; do + for o in 'D database' 'F files' 'Q query' 'R remove' 'S sync' 'U upgrade'; do _arch_incomp "$o" && break done if [[ $? != 0 ]]; then _arch_ptr2comp core elif [[ ! $prev =~ ^-\w*[Vbhr] && - ! $prev = --@(cachedir|color|config|dbpath|help|logfile|root|version) ]] + ! $prev = --@(cachedir|color|config|dbpath|help|hookdir|gpgdir|logfile|root|version) ]] then [[ $cur = -* ]] && _arch_ptr2comp ${o#* } common || case ${o% *} in D|R) _pacman_pkg Qq;; + F) + _arch_incomp 'l list' && _pacman_pkg -Slq; + ;; Q) { _arch_incomp 'g groups' && _pacman_pkg Qg sort; } || { _arch_incomp 'p file' && _pacman_file; } || -- 2.7.0
participants (1)
-
Allan McRae