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)
switch $ctoken
case '*=*'
# Some seds (e.g. on Mac OS X), don't support \n in the RHS
# Use a literal newline instead
# http://sed.sourceforge.net/sedfaq4.html#s4.1
set ctoken (echo $ctoken | sed 's/=/\\
/')
set ctoken (string split "=" -- $ctoken)
printf '%s\n' $ctoken[1]=(complete -C$ctoken[2])
case '*'
complete -C$ctoken