-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Labels
Description
Currently the following does not work:
# alias l=ls '-l -h -a'
# alias l=ls -lha'
$ ls -l -a -h foo
$ ls -lah foo
should be suggestion: l foo
.
The algorithm should change to a heuristic that in most cases finds the alias. What makes this non-trivial is at least:
--
must be respected as flag and argument terminator-foo
is indistinguishable from-f -o -o
for some commands but is actually--foo
for other commands-f bar
,--foo bar
, and--foo=bar
are not always identical depending on if-f|--foo
is and argument flag or bool flag.
Acceptance criteria and constraints:
- It's OK if only cases like
alias l=ls '-l -h -a'
are handled and not yetalias l=ls -lha'
. - The above case should be solved.
- No regression should be introduced.
- It's tolerable if it introduces a neglect able amount of false-positives, e.g.:
docker run foo -- -it
!=dr foo
(ordr foo --
) if aliasalias dr='docker run -it'
defined. - It's not tolerable for run-time to go up significantly, as one would have to check for all permutations over all aliases defined.