I would like to set up a few straight alias (without fixed ARGS) for some external executables in Eshell that need access to the command-line ARGS (that will vary). The function eshell-maybe-replace-by-alias
is expressly designed to omit the ARGS.
EXAMPLE: The alias
file within the Eshell folder [eshell-aliases-file
] contains the following entries below. When I call git diff SHA1234567890 > patch.diff
, eshell-maybe-replace-by-alias
excludes diff SHA1234567890
and the patch file that gets created is a printout from git
telling me what types of command line options are possible -- this is because git
was called by Eshell without any arguments.
alias git /Users/HOME/.0.data/.0.emacs/.0.macports/bin/git
alias curl /Users/HOME/.0.data/.0.emacs/.0.macports/bin/curl
I hacked the last line of eshell-maybe-replace-by-alias
to include the ARGS [i.e., ,(eshell-parse-command (nth 1 alias) args)
], but have a feeling that there may be an existing method to better handle this dilemma.
I played around with creating a custom function named eshell/COMMAND, but ran into several problems with with pre/post command hooks needing to be suppressed the first loop; an extra \n
that needed to be suppressed the second loop; escaping double-quotes (of strings greater than one word) in order to survive the first loop; and, an unresolved issue when dealing with redirection >
. Therefore, the hack of eshell-maybe-replace-by-alias
seems the easiest approach so far.
[I feel as though a bug report is not the right avenue at this point because Emacs 26 expressly has the ARGS labeled as _args
; i.e., disregard the ARGS.]