Browse code

fix completion for commands wrapped with bundler

Mario Fernandez authored on 10/09/2011 at 09:35:08
Showing 1 changed files
... ...
@@ -33,5 +33,10 @@ _run-with-bundler() {
33 33
 
34 34
 ## Main program
35 35
 for cmd in $bundled_commands; do
36
-  alias $cmd="_run-with-bundler $cmd"
36
+  eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
37
+  alias $cmd=bundled_$cmd
38
+
39
+  if which _$cmd > /dev/null 2>&1; then
40
+        compdef _$cmd bundled_$cmd
41
+  fi
37 42
 done