mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
improve realpath.fish comments
This commit is contained in:
parent
ce1c9f3a65
commit
94aeb47f63
@ -2,10 +2,12 @@
|
|||||||
# as a command. If a realpath command is available simply pass all arguments thru to it. If not
|
# as a command. If a realpath command is available simply pass all arguments thru to it. If not
|
||||||
# fallback to alternative solutions.
|
# fallback to alternative solutions.
|
||||||
|
|
||||||
# The following is slightly subtle. The first time `realpath` is invoked this script will be read.
|
# The following is slightly subtle. The first time `realpath` is invoked by autoloading this script
|
||||||
# If we see that there is an external command by that name we just return. That will cause fish to
|
# will be read. If we see that there is an external realpath command we just return. That will cause
|
||||||
# run the external command. On the other hand, if an external command isn't found we define a
|
# fish to run the external command. Or, if there is a grealpath, we alias it.
|
||||||
# function that will provide fallback behavior.
|
# On the other hand, if an external command isn't found we provide a function that will facilitate
|
||||||
|
# fallback behavion through our builtin.
|
||||||
|
|
||||||
if not command -s realpath >/dev/null
|
if not command -s realpath >/dev/null
|
||||||
|
|
||||||
if command -s grealpath >/dev/null
|
if command -s grealpath >/dev/null
|
||||||
@ -19,7 +21,8 @@ if not command -s realpath >/dev/null
|
|||||||
echo " resolves files as absolute paths without symlinks"
|
echo " resolves files as absolute paths without symlinks"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# loop over arguments - allow our realpath to work on more than one path per invocatgon like gnu/bsd realpath.
|
||||||
for arg in $argv
|
for arg in $argv
|
||||||
switch $arg
|
switch $arg
|
||||||
# These - no can do our realpath
|
# These - no can do our realpath
|
||||||
|
Loading…
x
Reference in New Issue
Block a user