OSDN Git Service

Apply re-definition hack to yash & vim
authormagicant <magicant@048f04df-13f5-43d7-8114-9f9ceecaec24>
Thu, 12 Jan 2017 12:08:50 +0000 (12:08 +0000)
committermagicant <magicant@048f04df-13f5-43d7-8114-9f9ceecaec24>
Thu, 12 Jan 2017 12:08:50 +0000 (12:08 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/yash/yash/trunk@3763 048f04df-13f5-43d7-8114-9f9ceecaec24

share/initialization/common

index 554c81b..4d39bfe 100644 (file)
@@ -79,6 +79,12 @@ rm() if [ -t 0 ]; then command rm -i "$@"; else command rm "$@"; fi
 
 # normally yash is more POSIX-compliant than /bin/sh :-)
 sh() { yash --posix "$@"; }
+yash() { command yash "$@"; }
+# By re-defining 'yash' using the 'command' built-in, the 'jobs' built-in
+# prints a command name that exposes the arguments like
+# 'yash --posix -n foo.sh' rather than a command name that hides the
+# arguments like 'yash --posix "${@}"'. This applies to the 'yash' command
+# invoked via the 'sh' function.
 
 # if the terminal supports color...
 if [ "$(tput colors 2>/dev/null || echo 0)" -ge 8 ]; then
@@ -102,6 +108,7 @@ if command --identify vim >/dev/null 2>&1; then
   # prefer vim over vi
   vi() { vim "$@"; }
   view() { vim -R "$@"; }
+  vim() { command vim "$@"; } # Re-definition hack. See above.
 
 fi