Another stringification (__fish_complete_command)

This commit is contained in:
Fabian Homborg 2016-02-04 13:53:55 +01:00
parent cadb5d51ea
commit b908d0b89b

View file

@ -2,11 +2,7 @@ function __fish_complete_command --description 'Complete using all available com
set -l ctoken (commandline -ct) set -l ctoken (commandline -ct)
switch $ctoken switch $ctoken
case '*=*' case '*=*'
# Some seds (e.g. on Mac OS X), don't support \n in the RHS set ctoken (string split "=" -- $ctoken)
# Use a literal newline instead
# http://sed.sourceforge.net/sedfaq4.html#s4.1
set ctoken (echo $ctoken | sed 's/=/\\
/')
printf '%s\n' $ctoken[1]=(complete -C$ctoken[2]) printf '%s\n' $ctoken[1]=(complete -C$ctoken[2])
case '*' case '*'
complete -C$ctoken complete -C$ctoken