]> git.puffer.fish Git - mirror/frr.git/commit
lib: make CLI completions less surprising
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 2 Dec 2016 21:02:51 +0000 (21:02 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 2 Dec 2016 21:02:51 +0000 (21:02 +0000)
commit1e35decffd9b5f9563337dd9b1b17cc0dcd1ebe6
tree3b1fdb7173c0e90ca25938645d9fe20718c649be
parent3857f9ff974ea0cee327f20c33417d82852d1304
lib: make CLI completions less surprising

* If a token matches exactly at the end of input, it still
  shows up in completions, e.g.

      ex# clear<?>
clear  Reset functions
      ex(config)# ip route 1.2.3.4<?>
        A.B.C.D    IP destination prefix
        A.B.C.D/M  IP destination prefix (e.g. 10.0.0.0/8)

* If a token in mid-line exactly matches one token and
  partially matches on one or more additional tokens,
  the command tree(s) under the partially matching tokens
  will be ignored in favor of the exact match when compiling
  completions for the full line, e.g.

      ex(config)# ip <?>

  will only show completions for commands under 'ip' and not
  those under 'ipv6', which the input partially matches.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/command_match.c