Bugzilla – Attachment 117549 Details for
Bug 27839
koha-worker missing tab-completion in bash
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27839: Add tab-completion in bash for koha-worker
Bug-27839-Add-tab-completion-in-bash-for-koha-work.patch (text/plain), 2.37 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-03-02 19:36:13 UTC
(
hide
)
Description:
Bug 27839: Add tab-completion in bash for koha-worker
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-03-02 19:36:13 UTC
Size:
2.37 KB
patch
obsolete
>From 1deae750fb24bfb9a038fb8bda1eb16035319f79 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 2 Mar 2021 15:20:41 -0300 >Subject: [PATCH] Bug 27839: Add tab-completion in bash for koha-worker > >This patch simply adds tab-completion for this script. > >To test: >1. Apply this patch >2. Run: > $ cp debian/koha-common.bash-completion /etc/bash_completion.d/koha-common >3. Open a new bash instance >4. Type 'koha-worker <tab>' >=> SUCCESS: All options are there >5. Play with Koha instances >=> SUCCESS: they show up, once chosen they are not offered anymore >6. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > debian/koha-common.bash-completion | 38 ++++++++++++++++++++++++++++++ > 1 file changed, 38 insertions(+) > >diff --git a/debian/koha-common.bash-completion b/debian/koha-common.bash-completion >index b40ae47a3a7..94966d360ef 100644 >--- a/debian/koha-common.bash-completion >+++ b/debian/koha-common.bash-completion >@@ -295,6 +295,44 @@ _koha-zebra() > } > complete -F _koha-zebra koha-zebra > >+ >+_koha-worker() >+{ >+ local cur opts substract >+ >+ COMPREPLY=() >+ _get_comp_words_by_ref cur >+ opts="--start --stop --restart --status --quiet -q --help -h" >+ >+ # Build a list of the already used option switches >+ for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do >+ if [[ ${COMP_WORDS[i]} == -* ]]; then >+ case ${COMP_WORDS[i]} in >+ --start) _koha_list_cmd ; return 0 ;; >+ --stop) _koha_list_cmd ; return 0 ;; >+ --restart) _koha_list_cmd ; return 0 ;; >+ --status) _koha_list_cmd ; return 0 ;; >+ --help) COMPREPLY=() ; return 0 ;; #Â no more completions >+ -h) COMPREPLY=() ; return 0 ;; #Â no more completions >+ --quiet) #Â filter the other quiet switches and go on >+ substract="$substract -e -q"; ;; >+ -q) #Â filter the other quiet switches and go on >+ substract="$substract -e --quiet"; ;; >+ esac >+ substract="$substract -e ${COMP_WORDS[i]}" >+ fi >+ done >+ >+ if [[ "$substract" != "" ]]; then >+ opts=$( echo $opts | sed -e 's/ /\n/g' | grep -v -x $substract ) >+ fi >+ >+ COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) >+ >+ return 0 >+} >+complete -F _koha-worker koha-worker >+ > _koha-sip() > { > local cur opts substract >-- >2.30.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27839
:
117549
|
117550
|
117557
|
117558
|
119426
|
119427