]> git.phdru.name Git - dotfiles.git/commitdiff
.shellrc: minor optimization in delegate_completion
authorOleg Broytman <phd@phdru.name>
Tue, 18 Oct 2016 19:29:09 +0000 (22:29 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 18 Oct 2016 19:29:09 +0000 (22:29 +0300)
.shellrc

index 130281854e9d4421e36b12bb425c05ae769e547e..e21f720b580c5deaef3660a3006cf4946d716a6d 100644 (file)
--- a/.shellrc
+++ b/.shellrc
@@ -119,10 +119,10 @@ if test -n "$BASH_VERSION"; then
    delegate_completion() {
       local prog completion_f programs
       prog="$1"
-      completion_f="$2"
-      shift; shift
-      programs="$@"
       if has_completion "$prog"; then
+         completion_f="$2"
+         shift; shift
+         programs="$@"
          eval "_${prog}_completion_loader() {
             _completion_loader $prog
             complete -F $completion_f $programs