From: Daniel Walton Date: Fri, 23 Sep 2016 14:02:55 +0000 (+0000) Subject: zebra: compress multiple whitespaces in command string X-Git-Tag: frr-3.0-branchpoint~129^2~176 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=0c515adf432ee0d02d38edc34de7666faaf323ba;p=matthieu%2Ffrr.git zebra: compress multiple whitespaces in command string Signed-off-by: Daniel Walton --- diff --git a/tools/argv_translator.py b/tools/argv_translator.py index 1c8f0c7e56..4ee0831ed9 100755 --- a/tools/argv_translator.py +++ b/tools/argv_translator.py @@ -267,6 +267,11 @@ DEFUN (no_bgp_maxmed_onstartup, line = line.replace('}', ']') re_range = re.search('^(.*?)<(\d+-\d+)>(.*)$', line) + # A one off to handle "CMD_RANGE_STR(1, MULTIPATH_NUM)" + if 'CMD_RANGE_STR<' in line: + line = line.replace('CMD_RANGE_STR<', 'CMD_RANGE_STR(') + line = line.replace('>', ')') + while re_range: line = "%s(%s)%s" % (re_range.group(1), re_range.group(2), re_range.group(3)) re_range = re.search('^(.*?)<(\d+-\d+)>(.*)$', line) @@ -274,6 +279,9 @@ DEFUN (no_bgp_maxmed_onstartup, if not line.endswith('\n'): line += '\n' + # compress duplicate whitespaces + re_space = re.search('^(\s*).*(\s*)$', line) + line = re_space.group(1) + ' '.join(line.split()) + re_space.group(2) return line def dump(self): diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index d395c11a11..3188799f26 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -655,7 +655,7 @@ DEFUN (ip_route_mask_tag_distance, DEFUN (ip_route_mask_flags_tag_distance, ip_route_mask_flags_tag_distance_cmd, - "ip route A.B.C.D A.B.C.D tag (1-65535) (1-255)", + "ip route A.B.C.D A.B.C.D tag (1-65535) (1-255)", IP_STR "Establish static routes\n" "IP destination prefix\n" @@ -1448,7 +1448,7 @@ DEFUN (ip_route_mask_tag_distance_vrf, DEFUN (ip_route_mask_flags_tag_distance_vrf, ip_route_mask_flags_tag_distance_vrf_cmd, - "ip route A.B.C.D A.B.C.D tag (1-65535) (1-255) " VRF_CMD_STR, + "ip route A.B.C.D A.B.C.D tag (1-65535) (1-255) " VRF_CMD_STR, IP_STR "Establish static routes\n" "IP destination prefix\n" @@ -2436,7 +2436,7 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, safi_t safi, DEFUN (show_ip_route_vrf, show_ip_route_vrf_cmd, - "show ip route " VRF_CMD_STR " [json]", + "show ip route " VRF_CMD_STR " [json]", SHOW_STR IP_STR "IP routing table\n" @@ -3420,7 +3420,7 @@ DEFUN (show_ip_route_vrf_all_supernets, DEFUN (show_ip_route_vrf_all_protocol, show_ip_route_vrf_all_protocol_cmd, - "show ip route " VRF_ALL_CMD_STR " " QUAGGA_IP_REDIST_STR_ZEBRA, + "show ip route " VRF_ALL_CMD_STR " " QUAGGA_IP_REDIST_STR_ZEBRA, SHOW_STR IP_STR "IP routing table\n" @@ -3475,7 +3475,7 @@ DEFUN (show_ip_route_vrf_all_protocol, DEFUN (show_ip_route_vrf_all_addr, show_ip_route_vrf_all_addr_cmd, - "show ip route " VRF_ALL_CMD_STR " A.B.C.D", + "show ip route " VRF_ALL_CMD_STR " A.B.C.D", SHOW_STR IP_STR "IP routing table\n"