The koha-indexer script should provide tab-completion in bash, as other scripts do.
Created attachment 41933 [details] [review] Bug 14727: koha-indexer tab completion in bash This patch introduces tab-completion in bash to the koha-indexer command. It completes using valid option switches and instance names. It stops completing then -h or --help are issued, and once a command switch is chosen (either --start, --stop or --restart) it goes ahead with valid instances completion. To test: - Have a packages install (kohadevbox works) - Run: $ . debian/koha-common.bash-completion - Type koha-indexer <tab> - Play with all the options => SUCCESS: They work as they should. - Sign off :-D Note: it fixes a small glitch on the plack completion.
Created attachment 43314 [details] [review] Bug 14727: koha-indexer tab completion in bash This patch introduces tab-completion in bash to the koha-indexer command. It completes using valid option switches and instance names. It stops completing then -h or --help are issued, and once a command switch is chosen (either --start, --stop or --restart) it goes ahead with valid instances completion. To test: - Have a packages install (kohadevbox works) - Run: $ . debian/koha-common.bash-completion - Type koha-indexer <tab> - Play with all the options => SUCCESS: They work as they should. - Sign off :-D Note: it fixes a small glitch on the plack completion. Signed-off-by: Jesse Weaver <pianohacker@gmail.com> Verified working, including filtering out already used options and instances.
Created attachment 43381 [details] [review] Bug 14727: koha-indexer tab completion in bash This patch introduces tab-completion in bash to the koha-indexer command. It completes using valid option switches and instance names. It stops completing then -h or --help are issued, and once a command switch is chosen (either --start, --stop or --restart) it goes ahead with valid instances completion. To test: - Have a packages install (kohadevbox works) - Run: $ . debian/koha-common.bash-completion - Type koha-indexer <tab> - Play with all the options => SUCCESS: They work as they should. - Sign off :-D Note: it fixes a small glitch on the plack completion. Signed-off-by: Jesse Weaver <pianohacker@gmail.com> Verified working, including filtering out already used options and instances. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The completion works but: root@kohadevbox:~# koha-indexer --start kohadev [ ok ] Starting Koha indexing daemon for kohadev:. root@kohadevbox:~# koha-indexer --stop kohadev [FAIL] Error: Indexer not running for kohadev: failed! root@kohadevbox:~# ps aux | grep zebra kohadev+ 509 0.0 0.0 18596 188 ? S 11:45 0:00 daemon --name=kohadev-koha-zebra --pidfiles=/var/run/koha/kohadev/ --errlog=/var/log/koha/kohadev/zebra-error.log --stdout=/var/log/koha/kohadev/zebra.log --output=/var/log/koha/kohadev/zebra-output.log --verbose=1 --respawn --delay=30 --user=kohadev-koha.kohadev-koha -- zebrasrv -v none,fatal,warn -f /etc/koha/sites/kohadev/koha-conf.xml kohadev+ 511 0.0 0.8 121780 9148 ? S 11:45 0:00 zebrasrv -v none,fatal,warn -f /etc/koha/sites/kohadev/koha-conf.xml kohadev+ 3017 0.0 0.0 18596 188 ? S 11:52 0:00 daemon --name=kohadev-koha-indexer --errlog=/var/log/koha/kohadev/indexer-error.log --stdout=/var/log/koha/kohadev/indexer.log --output=/var/log/koha/kohadev/indexer-output.log --verbose=1 --respawn --delay=30 --user=kohadev-koha.kohadev-koha -- /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -daemon -x -sleep 5 kohadev+ 3020 0.8 11.0 341964 113288 ? S 11:52 0:01 /usr/bin/perl /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -daemon -x -sleep 5
(In reply to Jonathan Druart from comment #4) > The completion works but: > > root@kohadevbox:~# koha-indexer --start kohadev > [ ok ] Starting Koha indexing daemon for kohadev:. > root@kohadevbox:~# koha-indexer --stop kohadev > [FAIL] Error: Indexer not running for kohadev: failed! > > root@kohadevbox:~# ps aux | grep zebra > kohadev+ 509 0.0 0.0 18596 188 ? S 11:45 0:00 daemon > --name=kohadev-koha-zebra --pidfiles=/var/run/koha/kohadev/ > --errlog=/var/log/koha/kohadev/zebra-error.log > --stdout=/var/log/koha/kohadev/zebra.log > --output=/var/log/koha/kohadev/zebra-output.log --verbose=1 --respawn > --delay=30 --user=kohadev-koha.kohadev-koha -- zebrasrv -v none,fatal,warn > -f /etc/koha/sites/kohadev/koha-conf.xml > kohadev+ 511 0.0 0.8 121780 9148 ? S 11:45 0:00 zebrasrv -v > none,fatal,warn -f /etc/koha/sites/kohadev/koha-conf.xml > kohadev+ 3017 0.0 0.0 18596 188 ? S 11:52 0:00 daemon > --name=kohadev-koha-indexer --errlog=/var/log/koha/kohadev/indexer-error.log > --stdout=/var/log/koha/kohadev/indexer.log > --output=/var/log/koha/kohadev/indexer-output.log --verbose=1 --respawn > --delay=30 --user=kohadev-koha.kohadev-koha -- > /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -daemon -x -sleep 5 > kohadev+ 3020 0.8 11.0 341964 113288 ? S 11:52 0:01 > /usr/bin/perl /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -daemon > -x -sleep 5 Please fill a bug for that...
Patch pushed to master.