[pacman-dev] [PATCH] bash_completion: remove upstream deprecated functions
Populate $cur and $prev with the new bash-completion 1.2 function, _get_comp_words_by_ref. _get_cword and _get_pword have been deprecated. Signed-off-by: Carlos Diaz <839273@gmail.com> --- contrib/bash_completion.in | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/contrib/bash_completion.in b/contrib/bash_completion.in index bdc4754..7f47f4b 100644 --- a/contrib/bash_completion.in +++ b/contrib/bash_completion.in @@ -30,8 +30,7 @@ _arch_incomp() { _makepkg() { local cur opts prev COMPREPLY=() - cur=$(_get_cword) - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev if [[ $cur = -* && ! $prev =~ ^-(-(cleancache|config|help)$|\w*[Chp]) ]]; then opts=('allsource asroot clean cleancache config force geninteg help holdver ignorearch install log nobuild nocolor noconfirm nodeps noextract @@ -55,8 +54,7 @@ _pacman_pkg() { _pacman() { local common core cur database prev query remove sync upgrade o COMPREPLY=() - cur=$(_get_cword) - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev database=('asdeps asexplicit') 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') -- 1.7.3.1
On Tue, Oct 12, 2010 at 11:46 PM, Carlos Diaz <839273@gmail.com> wrote:
Populate $cur and $prev with the new bash-completion 1.2 function, _get_comp_words_by_ref.
Hmm. So if this was just added, do we figure most people would have upgraded? I don't want to switch to something if Arch is the only one on 1.2. -Dan
_get_cword and _get_pword have been deprecated.
Signed-off-by: Carlos Diaz <839273@gmail.com> --- contrib/bash_completion.in | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/contrib/bash_completion.in b/contrib/bash_completion.in index bdc4754..7f47f4b 100644 --- a/contrib/bash_completion.in +++ b/contrib/bash_completion.in @@ -30,8 +30,7 @@ _arch_incomp() { _makepkg() { local cur opts prev COMPREPLY=() - cur=$(_get_cword) - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev if [[ $cur = -* && ! $prev =~ ^-(-(cleancache|config|help)$|\w*[Chp]) ]]; then opts=('allsource asroot clean cleancache config force geninteg help holdver ignorearch install log nobuild nocolor noconfirm nodeps noextract @@ -55,8 +54,7 @@ _pacman_pkg() { _pacman() { local common core cur database prev query remove sync upgrade o COMPREPLY=() - cur=$(_get_cword) - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev database=('asdeps asexplicit') 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') -- 1.7.3.1
On 14/10/10 16:13, Dan McGee wrote:
On Tue, Oct 12, 2010 at 11:46 PM, Carlos Diaz<839273@gmail.com> wrote:
Populate $cur and $prev with the new bash-completion 1.2 function, _get_comp_words_by_ref.
Hmm. So if this was just added, do we figure most people would have upgraded? I don't want to switch to something if Arch is the only one on 1.2.
I had the some thought. But bash-completion 1.2 was release 4 months ago and there will likely be a few more months before the next pacman release. So that is a fair window for updating. And to run into this people need to be updating their package manager which is a bigger upgrade than bash-completion. And even Cygwin has 1.2: http://cygwin.com/packages/bash-completion/ Allan
participants (3)
-
Allan McRae
-
Carlos Diaz
-
Dan McGee