AutoYADM commit: 2025-07-14 22:25:21

This commit is contained in:
Daniel Fichtinger 2025-07-14 22:25:21 -04:00
parent 23c5fc55bd
commit 7a0b858b3c

View file

@ -0,0 +1,18 @@
function uri-path
argparse h/help r/reverse -- $argv
if set -q _flag_h
echo "Convert a file URI to a Path."
echo "-h/--help for help."
echo "-r/--reverse to convert a path to URI."
end
if test -z "$argv[1]"
read -f input
else
set input $argv[1]
end
if not set -q _flag_r
string unescape --style=url "$input" | string replace -a ' ' '\\ ' | string replace 'file://' ''
else
printf 'file://%s\n' (string replace '\\ ' ' ' "$input" | string escape --style=url)
end
end