dparrish / libcli

Libcli provides a shared library for including a Cisco-like command-line interface into other software. It's a telnet interface which supports command-line editing, history, authentication and callbacks for a user-definable function tree.
https://dparrish.com/link/libcli
GNU Lesser General Public License v2.1
289 stars 144 forks source link

filter abbreviations gives unexpected results #36

Closed FransM closed 3 years ago

FransM commented 5 years ago

If as a a filter I give "| e" egrep is chosen although the e also could match exclude I had expected an error or autocompletion hint. I suspect I got egrep because it is alphabetically first.

Example:

router> show counters | e call called cmd_test with "show counters"

router> show counters | eg call called cmd_test with "show counters"

router> show counters | ex call 0 arguments:

I suspect something similar will happen with "b" as it can match begin and between

RobSanders commented 3 years ago

Work done in V1.10.0 fixed this so filters are treated 'like' commands. If you don't give enough letters to unambiguously identify the command it will report 'invalid command' with the letters typed.