Bugzilla – Attachment 41867 Details for
Bug 14714
koha-mysql tab-completion in bash
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14714: Add tab-completion to koha-mysql command
Bug-14714-Add-tab-completion-to-koha-mysql-command.patch (text/plain), 1.69 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-08-24 18:47:56 UTC
(
hide
)
Description:
Bug 14714: Add tab-completion to koha-mysql command
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-08-24 18:47:56 UTC
Size:
1.69 KB
patch
obsolete
>From d74dfa361267fcf87ab658b4d0eb7fc44ae23a4f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 24 Aug 2015 15:44:22 -0300 >Subject: [PATCH] Bug 14714: Add tab-completion to koha-mysql command > >This patch introduces tab-completion in bash to the koha-mysql >command. It completes using valid instance names. It stops completing >once an instance name is chosen (i.e. it respects the fact that >koha-mysql accepts only one instance name as parameter). > >To test: >- Have a packages install (kohadevbox works) >- Run: > $ . debian/koha-common.bash-completion >- Type > koha-mysql <tab> >=> SUCCESS: You are prompted valid instance names for completion. >- Sign off :-D >--- > debian/koha-common.bash-completion | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > >diff --git a/debian/koha-common.bash-completion b/debian/koha-common.bash-completion >index 07bcdc1..d65aba2 100644 >--- a/debian/koha-common.bash-completion >+++ b/debian/koha-common.bash-completion >@@ -43,6 +43,21 @@ _build_substract_instances() > echo "$substract" > } > >+_koha_single_instance() >+{ >+ local filter=$1 >+ >+ cur=${COMP_WORDS[COMP_CWORD]} >+ prev=${COMP_WORDS[COMP_CWORD-1]} >+ if [ $COMP_CWORD -eq 1 ]; then >+ COMPREPLY=( $( compgen -W "$(koha-list $filter)" $cur ) ) >+ else >+ COMPREPLY=() >+ fi >+ >+ return 0 >+} >+ > _koha_list_cmd() > { > local filter=$1 >@@ -120,6 +135,9 @@ complete -F _koha_enabled_instances koha-start-zebra > complete -F _koha_enabled_instances koha-restart-zebra > complete -F _koha_enabled_instances koha-stop-zebra > >+# koha-mysql autocompletes with a single instance name >+complete -F _koha_single_instance koha-mysql >+ > _koha_list() > { > local cur opts substract >-- >2.5.0
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 14714
:
41867
|
41868
|
41928