AutoYADM commit: 2025-07-14 22:40:39
This commit is contained in:
parent
7a0b858b3c
commit
bd10e6bfc3
1 changed files with 5 additions and 4 deletions
|
@ -4,15 +4,16 @@ function uri-path
|
|||
echo "Convert a file URI to a Path."
|
||||
echo "-h/--help for help."
|
||||
echo "-r/--reverse to convert a path to URI."
|
||||
return 0
|
||||
end
|
||||
if test -z "$argv[1]"
|
||||
if test -z "$argv"
|
||||
read -f input
|
||||
else
|
||||
set input $argv[1]
|
||||
set input $argv
|
||||
end
|
||||
if not set -q _flag_r
|
||||
string unescape --style=url "$input" | string replace -a ' ' '\\ ' | string replace 'file://' ''
|
||||
string unescape --style=url "$input" | string replace 'file://' ''
|
||||
else
|
||||
printf 'file://%s\n' (string replace '\\ ' ' ' "$input" | string escape --style=url)
|
||||
printf 'file://%s\n' (string escape --style=url "$input")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue