$alias -- returns the name of the calling alias.
Intended to be simple, and not to enumerate or transcending the calling tree, but just return the name of the parent caller.
This is usually something that the user hand-typed as a command.

This is a request for $alias, not to be confused with $alias().

Code:
ALIAS foo /zig $1-
ALIAS bar /zig $1-
ALIAS baz /zig $1-

ALIAS zig {
  ... stuff stuff stuff ...
  if ($alias == foo) echo -a foo stuff $1-
  if ($alias == bar) echo -a bar stuff $1-
  if ($alias == baz) echo -a baz stuff $1-
}

This has the specific benefit of multiple commands sharing a bulk of code, without necessarily having to pass and parse -various -switch -parameters.

Easter egg: Make it PrEsErVe CaSe so we can tell IF THE USER IS SHOUTING /COMMANDS

Edit: I am embarrassed to discover that I've made this request a few times before.

Last edited by Raccoon; 14/06/18 02:59 PM. Reason: electric sheepish

Well. At least I won lunch.
Good philosophy, see good in bad, I like!