From fdd40d514dd34d8736908bff27ffb01f88aa238a Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 18 Mar 2021 15:42:36 -0400 Subject: [PATCH] doc: update docs for `find REGEX...` command Signed-off-by: Quentin Young --- doc/user/basic.rst | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/doc/user/basic.rst b/doc/user/basic.rst index 5cbd3692dc..88726e4b53 100644 --- a/doc/user/basic.rst +++ b/doc/user/basic.rst @@ -513,32 +513,43 @@ Terminal Mode Commands Send a message to all logging destinations that are enabled for messages of the given severity. -.. clicmd:: find COMMAND... +.. clicmd:: find REGEX... - This command performs a simple substring search across all defined commands - in all modes. As an example, suppose you're in enable mode and can't - remember where the command to turn OSPF segment routing on is: + This command performs a regex search across all defined commands in all + modes. As an example, suppose you're in enable mode and can't remember where + the command to turn OSPF segment routing on is: :: frr# find segment-routing on (ospf) segment-routing on + (isis) segment-routing on + The CLI mode is displayed next to each command. In this example, :clicmd:`segment-routing on` is under the `router ospf` mode. - Similarly, suppose you want a listing of all commands that contain "l2vpn": + Similarly, suppose you want a listing of all commands that contain "l2vpn" + and "neighbor": :: - frr# find l2vpn - (view) show [ip] bgp l2vpn evpn [json] - (view) show [ip] bgp l2vpn evpn all [json] - (view) show [ip] bgp l2vpn evpn all neighbors A.B.C.D advertised-routes [json] - (view) show [ip] bgp l2vpn evpn all neighbors A.B.C.D routes [json] - (view) show [ip] bgp l2vpn evpn all overlay + frr# find l2vpn.*neighbor + (view) show [ip] bgp l2vpn evpn neighbors advertised-routes [json] + (view) show [ip] bgp l2vpn evpn neighbors routes [json] + (view) show [ip] bgp l2vpn evpn rd ASN:NN_OR_IP-ADDRESS:NN neighbors advertised-routes [json] + (view) show [ip] bgp l2vpn evpn rd ASN:NN_OR_IP-ADDRESS:NN neighbors routes [json] ... + + Note that when entering spaces as part of a regex specification, repeated + spaces will be compressed into a single space for matching purposes. This is + a consequence of spaces being used to delimit CLI tokens. If you need to + match more than one space, use the ``\s`` escape. + + POSIX Extended Regular Expressions are supported. + + .. _common-show-commands: .. clicmd:: show thread cpu [r|w|t|e|x] -- 2.39.5