http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10003
Jonathan Druart <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26179|0 |1 is obsolete| | Attachment #26180|0 |1 is obsolete| | --- Comment #17 from Jonathan Druart <[email protected]> --- Created attachment 26476 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26476&action=edit Bug 10003: bash-completion for koha-list and some other script This is an initial commit submitted for peer review. It implements bash-completion for the following commands: - koha-list - koha-enable - koha-disable - koha-email-enable - koha-email-disable - koha-enable-sip - koha-start-sip - koha-restart-sip - koha-stop-sip - koha-start-zebra - koha-stop-zebra - koha-restart-zebra It is implemented in a way that it removes already used or mutually exclusive parameters (instance names, option switches). I already have written completion for other (more complex) commands, But I belive a simpler patch is better to start with. IMPORTANT: this patch relies on having the koha-list command available in the path. Also 10622 is needed for the SIP-related option switches. To test: - Make sure you have bash-completion installed and enabled (IRC might help us if you encounter problems). - Apply the patch. Option 1: - Pick the debian/koha-common.bash-completion file and do $ cp debian/koha-common.bash-completion /etc/bash_completion.d/koha-common - Open a new bash shell (I do it opening a new terminal on my Ubuntu box). - Type one of the listed commands... And repeatedly press <TAB>. - Enjoy, and signoff if you belive it is usable. Otherwise report back. Option 2: - run: $ . debian/koha-common.bash-completion - Type one of the listed commands... And repeatedly press <TAB>. - Enjoy, and signoff if you belive it is usable. Otherwise report back. Tests: - Some koha-list option switches are mutually exclusive, -h should be available in any context - koha-enable should only autocomplete disabled instances - koha-disable should only autocomplete enabled instances - koha-email-enable should only autocomplete email-disabled instances - koha-email-disable should only autocomplete email-enabled instances - koha-*-zebra scripts should only autocomplete enabled instances. - koha-*-sip scripts should only autocomplete sip-enabled instances. Regards To+ Note: writing bash-completion routines is a bit hacky, I tried to make it the simplest way I could. Your comments are welcome. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Dobrica Pavlinusic <[email protected]> Signed-off-by: Jonathan Druart <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
