Closed gilmrjc closed 8 years ago
To understand correctly: You mean having alias f=foo
and alias fo=foo
gives tip f
.
Could you define "other"? It sound like you get an unexpected result. You expect maybe both f & fo
as tips?
The bc command has 2 aliases: "calc" and "=". When I use = I get the following:
$ = 5+5
Alias tip: calc 5+5
10
But "=" is not a command, is an alias.
I expect to get an alias tip when calling the command, but no when calling another alias of the same command
How did you manage to make =
an alias? Could you post the output of alias
here, please? bc 5+5
gives me File 5+5 is unavailable.
.
The plugin I'm using (https://github.com/arzzen/calc.plugin.zsh) do this:
# bc - An arbitrary precision calculator language
function =
{
echo "$@" | bc -l
}
alias calc="="
About this:
calc should not have been suggested as alias tip, because it's longer than the actual command, here =.
I get tips even if they are longer than the actual command. Is this another bug?
$ sudo whoami
Alias tip: please whoami
root
OK, that clarifies a bit. So =
is not an alias, it's a function. Alias-tips currently does not consider functions any special to programs, as it's hard argue that all functions are entirely different from programs.
I could imagine consider a flag to introduce Do not offer aliases for functions.
@gilmrjc Could you try https://github.com/djui/alias-tips/pull/25 (tests currently don't pass and need to be updated)
Yes, it works fine now :smiley:
$ = 5+5
10
If two or more aliases are used for the same command, alias-tip gives me the other alias as tip.