The (faulty) detection of recursive Aliases was removed in
a656fd0693, claiming that "our nesting
limit will catch issues now." However, nested Aliases weren't actually
increasing the nesting level.
Actually increasing the nesting level when an alias is executed restores
the intended behavior. Additionally, limiting the size of the
expanded arguments to an alias prevents exponential growth of memory
usage for certain malicious inputs/aliases.
Signed-off-by: James McCoy <vega.james@gmail.com>
Plugins which implement their own listCommands method should pass their
non-typically discoverable commands to Commands.listCommands via this
mechanism. This means that the de-duplication of commands is performed in one
spot instead of having each plugin implement it on their on in their
listCommands method.
This reverts commits 0ce829af6215b97e725f4d6d580d1151950be869 and
09fb0e6fc974445a3414fb03a94625f8538d4570.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>