mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-18 12:33:38 +08:00
0abdf9eeff
Work on #68.
11 lines
263 B
Fish
11 lines
263 B
Fish
function __fish_urlencode --description "URL-encode stdin"
|
|
set -l IFS ''
|
|
set -l output
|
|
while read --array --local lines
|
|
if [ (count $lines) -gt 0 ]
|
|
set output $output (printf '%%%02x' "'"$lines"'" | sed -e 's/%2[fF]/\//g')
|
|
end
|
|
end
|
|
echo -s $output
|
|
end
|