DannyBen / alf

Bash Alias Generator and Manager
MIT License
90 stars 5 forks source link

Avoid adding "$@" if the command contains a $ sign #11

Closed DannyBen closed 5 years ago

DannyBen commented 5 years ago

Right now, if we want to specify a command that accepts arguments, like this:

count: ls -1 ${1:-.} | wc -l

We must end the command with a # sign, since alf adds "$@" at the end.

It should be easy to avoid adding this suffix, if the command already includes a $ sign - in this case, we "transfer argument control" to the user.

Another option, is to allow a more explicit "opt out" from this behavior, in case someone wants to avoid this suffix in a command that does not include a $ symbol.