From 94aeb47f63db0bc34776f196e0544d078a91685b Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sun, 2 Oct 2016 02:44:33 -0700 Subject: [PATCH] improve realpath.fish comments --- share/functions/realpath.fish | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/share/functions/realpath.fish b/share/functions/realpath.fish index f1e8b86d6..0d20ab6de 100644 --- a/share/functions/realpath.fish +++ b/share/functions/realpath.fish @@ -2,10 +2,12 @@ # as a command. If a realpath command is available simply pass all arguments thru to it. If not # fallback to alternative solutions. -# The following is slightly subtle. The first time `realpath` is invoked this script will be read. -# If we see that there is an external command by that name we just return. That will cause fish to -# run the external command. On the other hand, if an external command isn't found we define a -# function that will provide fallback behavior. +# The following is slightly subtle. The first time `realpath` is invoked by autoloading this script +# will be read. If we see that there is an external realpath command we just return. That will cause +# fish to run the external command. Or, if there is a grealpath, we alias it. +# 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 command -s grealpath >/dev/null @@ -19,7 +21,8 @@ if not command -s realpath >/dev/null echo " resolves files as absolute paths without symlinks" return 1 end - + + # loop over arguments - allow our realpath to work on more than one path per invocatgon like gnu/bsd realpath. for arg in $argv switch $arg # These - no can do our realpath