Use string replace instead of sed (#87)

It seems like this was broken on my machine (OSX, 10.14.6) when using the completions. It would strip the `, ` but it would not add a proper newline. Instead it added nothing. So it just become a giant single line. Basically, it didn’t work.

With this change, the string gets split properly. Since this is fish shell, the `string replace` command is guaranteed to be there.
This commit is contained in:
James Doyle 2019-08-27 15:51:35 -07:00 committed by Danilo Bargen
commit 15583fc6d0

View file

@ -15,7 +15,7 @@ complete -c tldr -l config-path -d 'Show config file path.' -f
complete -c tldr -l seed-config -d 'Create a basic config.' -f
function __tealdeer_entries
tldr --list | sed -e 's/, /\n/g'
tldr --list | string replace -a -i -r "\,\s" "\n"
end
complete -f -c tldr -a '(__tealdeer_entries)'