aboutsummaryrefslogtreecommitdiffhomepage
path: root/share
diff options
context:
space:
mode:
authorGravatar Josh Kuhn <deontologician@gmail.com>2014-05-02 17:49:24 -0400
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-05-03 15:06:57 -0700
commitcbef88a593d01194d81fb24bbc616a4d72718546 (patch)
treeaddc9deb27e08d5e22f0a554896b1df3ba7d8dec /share
parentb13179d4f4921db84c2f870d1b372fe537449e96 (diff)
Fix python completion to work for pypy
Pypy outputs 2 lines with the -V option, as well as adding a whole lot of stuff that confuses the very general sed regex that was used before.
Diffstat (limited to 'share')
-rw-r--r--share/functions/__fish_complete_python.fish2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/functions/__fish_complete_python.fish b/share/functions/__fish_complete_python.fish
index 899add7f..46d2e5d8 100644
--- a/share/functions/__fish_complete_python.fish
+++ b/share/functions/__fish_complete_python.fish
@@ -18,7 +18,7 @@ function __fish_complete_python -d 'Make completion for python' --argument-names
complete -c $cmd -a "(__fish_complete_suffix .py)"
complete -c $cmd -a '-' -d 'Read program from stdin'
- switch (eval $cmd -V 2>| sed 's/^.*\s\(.\).*/\1/')
+ switch (eval $cmd -V 2>&1 | head -n1 | sed 's/^.*\s\([23]\)\..*/\1/')
case 2
complete -c $cmd -s 3 -d 'Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix'
complete -c $cmd -s t --description "Warn on mixed tabs and spaces"