Fix erroneous \t in sysctl completion (#3562)

The last commit to this auto completion changed it to use `string replace` instead of `tr`. Unfortunately they do not behave the same. `tr " = " "\t"` replaces " = " with a tabulator character, while `string replace -a " = " "\t"` replaces it with \t. Either `string` is misbehaving or this auto completion was broken.
This commit is contained in:
maxried 2016-11-18 20:10:09 +01:00 committed by Aaron Gyes
parent acc2353328
commit 2e5693a6bc

View file

@ -3,7 +3,7 @@ if type -q -f sysctl
if sysctl -h >/dev/null ^/dev/null
# Print sysctl keys and values, separated by a tab
function __fish_sysctl_values
sysctl -a ^/dev/null | string replace -a " = " "\t"
sysctl -a ^/dev/null | string replace -a " = " \t
end
complete -c sysctl -a '(__fish_sysctl_values)' -f
@ -32,7 +32,7 @@ if type -q -f sysctl
else
# OSX sysctl
function __fish_sysctl_values
sysctl -a ^/dev/null | string replace -a ":" "\t"
sysctl -a ^/dev/null | string replace -a ":" \t
end
complete -c sysctl -a '(__fish_sysctl_values)' -f