]> git.proxmox.com Git - mirror_frr.git/commit
vtysh: Extending vtysh to allow question-mark cmds
authorRodny Molina <rmolina@linkedin.com>
Fri, 11 May 2018 05:15:48 +0000 (22:15 -0700)
committerRodny Molina <rmolina@linkedin.com>
Sun, 13 May 2018 01:59:11 +0000 (18:59 -0700)
commita4364a44ae3180536b8f6faac0ca2f1404915385
tree94e751b708929ed85394e0ffffe38eda7dface30
parent05859298a3979eaa1a802174128b3342be47c7b1
vtysh: Extending vtysh to allow question-mark cmds

Currently, "vtysh -c" interface does not provide a logic to parse
commands ending with '?' character. In consequence, the following behavior
is observed:

$ vtysh -c "show bgp ?"
 % Unknown command.

With these changes, i'm extending FRR's parser to be able to handle
these commands, which allow a more friendly interaction with users
that rely on "vtysh -c" interface. The typical use-case here is for
scenarios in which the final users relie on external/their-own CLI and
require a friendly interface to FRR's vtysh cli.

$ vtysh -c "show bgp ?"
  <cr>
   A.B.C.D               Network in the BGP routing table to
   display
   A.B.C.D/M             IPv4 prefix
   X:X::X:X              Network in the BGP routing table to display
   X:X::X:X/M            IPv6 prefix
   attribute-info        List all bgp attribute information
   cidr-only             Display only routes with non-natural netmasks
   community             Display routes matching the communities
   community-info        List all bgp community information
 ...

Signed-off-by: Rodny Molina <rmolina@linkedin.com>
vtysh/vtysh.c
vtysh/vtysh.h
vtysh/vtysh_main.c