ConfD User Community

Disable alias expansion


#1

Hi,

I have a command to display the interface information like “show interface ethernet”. I created an alias for it as “sint”.
When i excute sint, i the next line confd shows the expanded form of sint as “show interface ethernet” and only then prints the info.
con# sint
con# show interface ethernet
%No entries

Is it possible to hide or suppress the expansion line - # show interface ethernet
and make confd print something like
con# sint
%No entries


#2

Have you tried /confdConfig/cli/expandAliasOnCompletion - see man confd.conf? Sounds like what you are looking for.


#3

Hi @mvf, I did try expandAliasOnCompletion. When this is set to true how it works is:
If user types the alias as sintf and press tab the sintf alias is being expanded to its full form on the same line. When its set to false it doesn’t expand on tab.
But even when it is set to true also, when we type sintf and enter the command gets expanded and printed on the second line.


#4

Maybe it is not possible to disable CLI alias expansion then. If you really need a command that is effectively just an alias but does not get expanded, implement a custom command - a custom command implemented as a shell script that does not do anything else then just call the real command (possibly using maapi --clicmd ...) should be fairly straightforward.