]> git.puffer.fish Git - mirror/frr.git/commitdiff
all: added some missing <>s within []s
authorDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 30 Sep 2016 15:31:48 +0000 (15:31 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 30 Sep 2016 15:31:48 +0000 (15:31 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
14 files changed:
bgpd/bgp_route.c
bgpd/bgp_routemap.c
isisd/isis_redist.c
lib/command.c
ospf6d/ospf6_area.c
ospf6d/ospf6_lsa.c
ospf6d/ospf6_neighbor.c
ospf6d/ospf6_top.c
ospf6d/ospf6d.c
ospfd/ospf_dump.c
ripd/rip_interface.c
tools/argv_translator.py
zebra/debug.c
zebra/zebra_vty.c

index eca6a4a7b3eb4cdabdad7ed6c563dfefd20b3580..bb1849e4b42372753bd2caa3f9f7e7a155339ec4 100644 (file)
@@ -7732,7 +7732,7 @@ bgp_show_route (struct vty *vty, const char *view_name, const char *ip_str,
 /* BGP route print out function. */
 DEFUN (show_ip_bgp_ipv4,
        show_ip_bgp_ipv4_cmd,
-       "show [ip] bgp [<view|vrf> WORD] [<<ipv4|ipv6|vpnv4|encap> [unicast]|ipv4 multicast>] [cidr-only|community|<[dampening] <flap-statistics|dampened-paths>>|regexp .LINE|route-map WORD|prefix-list WORD|filter-list WORD|community <AA:NN|local-AS|no-advertise|no-export> [exact-match]|community-list <(1-500)|WORD> [exact-match]|<A.B.C.D/M|k X:X::X:X/M> longer-prefixes] [json]",
+       "show [ip] bgp [<view|vrf> WORD] [<<ipv4|ipv6|vpnv4|encap> [unicast]|ipv4 multicast>] [<cidr-only|community|dampening <flap-statistics|dampened-paths>|regexp .LINE|route-map WORD|prefix-list WORD|filter-list WORD|community <AA:NN|local-AS|no-advertise|no-export> [exact-match]|community-list <(1-500)|WORD> [exact-match]|A.B.C.D/M longer-prefixes|X:X::X:X/M longer-prefixes>] [json]",
        SHOW_STR
        IP_STR
        BGP_STR
@@ -7857,7 +7857,7 @@ DEFUN (show_ip_bgp_ipv4,
 
 DEFUN (show_ip_bgp_route,
        show_ip_bgp_route_cmd,
-       "show [ip] bgp [<view|vrf> WORD] [<<ipv4|ipv6|encap> [unicast]|ipv4 multicast|vpnv4 unicast [rd ASN:nn_or_IP-address:nn]>] <A.B.C.D|A.B.C.D/M|X:X::X:X|X:X::X:X/M> [bestpath|multipath] [json]",
+       "show [ip] bgp [<view|vrf> WORD] [<<ipv4|ipv6|encap> [unicast]|ipv4 multicast|vpnv4 unicast [rd ASN:nn_or_IP-address:nn]>] <A.B.C.D|A.B.C.D/M|X:X::X:X|X:X::X:X/M> [<bestpath|multipath>] [json]",
        SHOW_STR
        IP_STR
        BGP_STR
index e08b43bc17a7f7e342d0103b437984e498bc7955..d823b962b83903693a653e922d6aa11876b3d4ec 100644 (file)
@@ -3091,7 +3091,7 @@ DEFUN (match_ip_next_hop,
 
 DEFUN (no_match_ip_next_hop,
        no_match_ip_next_hop_cmd,
-       "no match ip next-hop [<(1-199)|(1300-2699)|WORD]",
+       "no match ip next-hop [<(1-199)|(1300-2699)|WORD>]",
        NO_STR
        MATCH_STR
        IP_STR
@@ -3158,7 +3158,7 @@ DEFUN (match_ip_route_source,
 
 DEFUN (no_match_ip_route_source,
        no_match_ip_route_source_cmd,
-       "no match ip route-source [(1-199)|(1300-2699)|WORD]",
+       "no match ip route-source [<(1-199)|(1300-2699)|WORD>]",
        NO_STR
        MATCH_STR
        IP_STR
index e330a101709aee3fffcf9d14d5dd4a0169327963..384eb3572bc38120afaeb7d62abed3babdbadfe0 100644 (file)
@@ -539,7 +539,7 @@ isis_redist_area_finish(struct isis_area *area)
 
 DEFUN (isis_redistribute,
        isis_redistribute_cmd,
-       "redistribute <ipv4|ipv6> <kernel|connected|static|rip|ripng|ospf|ospf6|bgp|pim|table> <level-1|level-2> [metric (0-16777215)|route-map WORD]",
+       "redistribute <ipv4|ipv6> <kernel|connected|static|rip|ripng|ospf|ospf6|bgp|pim|table> <level-1|level-2> [<metric (0-16777215)|route-map WORD>]",
        REDIST_STR
        "Redistribute IPv4 routes\n"
        "Redistribute IPv6 routes\n"
index 95d69cdbf66b9dfc0d5bf8e1b630af22726bb53b..c98e2562db47a7d947dac23c04491e56f2fbbdc7 100644 (file)
@@ -1696,7 +1696,7 @@ DEFUN (show_logging,
 
 DEFUN (config_log_stdout,
        config_log_stdout_cmd,
-       "log stdout [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
+       "log stdout [<emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>]",
        "Logging control\n"
        "Set stdout logging level\n"
        LOG_LEVEL_DESC)
@@ -1718,7 +1718,7 @@ DEFUN (config_log_stdout,
 
 DEFUN (no_config_log_stdout,
        no_config_log_stdout_cmd,
-       "no log stdout [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
+       "no log stdout [<emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>]",
        NO_STR
        "Logging control\n"
        "Cancel logging to stdout\n"
@@ -1730,7 +1730,7 @@ DEFUN (no_config_log_stdout,
 
 DEFUN (config_log_monitor,
        config_log_monitor_cmd,
-       "log monitor [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
+       "log monitor [<emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>]",
        "Logging control\n"
        "Set terminal line (monitor) logging level\n"
        LOG_LEVEL_DESC)
@@ -1752,7 +1752,7 @@ DEFUN (config_log_monitor,
 
 DEFUN (no_config_log_monitor,
        no_config_log_monitor_cmd,
-       "no log monitor [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
+       "no log monitor [<emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>]",
        NO_STR
        "Logging control\n"
        "Disable terminal line (monitor) logging\n"
@@ -1818,7 +1818,7 @@ set_log_file(struct vty *vty, const char *fname, int loglevel)
 
 DEFUN (config_log_file,
        config_log_file_cmd,
-       "log file FILENAME [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
+       "log file FILENAME [<emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>]",
        "Logging control\n"
        "Logging to file\n"
        "Logging filename\n"
@@ -1859,7 +1859,7 @@ DEFUN (no_config_log_file,
 
 DEFUN (config_log_syslog,
        config_log_syslog_cmd,
-       "log syslog [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
+       "log syslog [<emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>]",
        "Logging control\n"
        "Set syslog logging level\n"
        LOG_LEVEL_DESC)
@@ -1897,7 +1897,7 @@ DEFUN_DEPRECATED (config_log_syslog_facility,
 
 DEFUN (no_config_log_syslog,
        no_config_log_syslog_cmd,
-       "no log syslog [<kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7>] [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
+       "no log syslog [<kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7>] [<emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>]",
        NO_STR
        "Logging control\n"
        "Cancel logging to syslog\n"
index 766562a8289a60fd688be0bf4aa88c5fe8303e77..45e7f720f3653bc19a76b5aab75bef722adfcf43 100644 (file)
@@ -435,7 +435,7 @@ ospf6_area_show (struct vty *vty, struct ospf6_area *oa)
 
 DEFUN (area_range,
        area_range_cmd,
-       "area <A.B.C.D|(0-4294967295) range X:X::X:X/M [<advertise|not-advertise|cost (0-16777215)>]",
+       "area <A.B.C.D|(0-4294967295)> range X:X::X:X/M [<advertise|not-advertise|cost (0-16777215)>]",
        "OSPF area parameters\n"
        OSPF6_AREA_ID_STR
        "Configured address range\n"
index c65cae39276786dc2ecb80ef2d0c9bcc40c01450..87e50bcf865c066b52af8c69810b297bc436645e 100644 (file)
@@ -818,7 +818,7 @@ ospf6_lsa_handler_name (struct ospf6_lsa_handler *h)
 
 DEFUN (debug_ospf6_lsa_type,
        debug_ospf6_lsa_hex_cmd,
-       "debug ospf6 lsa <router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown> [originate|examine|flooding]",
+       "debug ospf6 lsa <router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown> [<originate|examine|flooding>]",
        DEBUG_STR
        OSPF6_STR
        "Debug Link State Advertisements (LSAs)\n"
@@ -861,7 +861,7 @@ DEFUN (debug_ospf6_lsa_type,
 
 DEFUN (no_debug_ospf6_lsa_type,
        no_debug_ospf6_lsa_hex_cmd,
-       "no debug ospf6 lsa <router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown> [originate|examine|flooding]",
+       "no debug ospf6 lsa <router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown> [<originate|examine|flooding>]",
        NO_STR
        DEBUG_STR
        OSPF6_STR
index 1c55175d20396ba16c12a6509ac9cd6df16fd996..91c7f7c62c9d6ba3124ff6515874e45648b802c6 100644 (file)
@@ -829,7 +829,7 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on)
 
 DEFUN (show_ipv6_ospf6_neighbor,
        show_ipv6_ospf6_neighbor_cmd,
-       "show ipv6 ospf6 neighbor [detail|drchoice]",
+       "show ipv6 ospf6 neighbor [<detail|drchoice>]",
        SHOW_STR
        IP6_STR
        OSPF6_STR
@@ -918,7 +918,7 @@ ospf6_neighbor_init (void)
 
 DEFUN (debug_ospf6_neighbor,
        debug_ospf6_neighbor_cmd,
-       "debug ospf6 neighbor [state|event]",
+       "debug ospf6 neighbor [<state|event>]",
        DEBUG_STR
        OSPF6_STR
        "Debug OSPFv3 Neighbor\n"
@@ -945,7 +945,7 @@ DEFUN (debug_ospf6_neighbor,
 
 DEFUN (no_debug_ospf6_neighbor,
        no_debug_ospf6_neighbor_cmd,
-       "no debug ospf6 neighbor [state|event]",
+       "no debug ospf6 neighbor [<state|event>]",
        NO_STR
        DEBUG_STR
        OSPF6_STR
index 58301b1c0f6ff8c18c3d831aa93705b6696bdb32..ccffa131a63ee89fd61c24639adc7e7c6d70c7d1 100644 (file)
@@ -768,7 +768,7 @@ DEFUN (show_ipv6_ospf6,
 
 DEFUN (show_ipv6_ospf6_route,
        show_ipv6_ospf6_route_cmd,
-       "show ipv6 ospf6 route [intra-area|inter-area|external-1|external-2|X:X::X:X|X:X::X:X/M|detail|summary]",
+       "show ipv6 ospf6 route [<intra-area|inter-area|external-1|external-2|X:X::X:X|X:X::X:X/M|detail|summary>]",
        SHOW_STR
        IP6_STR
        OSPF6_STR
index 785c9361c04ced3904fab65ad7e5ac42bfa12bcd..3e2db84a67363edb37252187abbc81d37d88fe72 100644 (file)
@@ -171,7 +171,7 @@ parse_type_spec (int idx_lsa, int argc, struct cmd_token **argv)
 
 DEFUN (show_ipv6_ospf6_database,
        show_ipv6_ospf6_database_cmd,
-       "show ipv6 ospf6 database [detail|dump|internal]",
+       "show ipv6 ospf6 database [<detail|dump|internal>]",
        SHOW_STR
        IPV6_STR
        OSPF6_STR
index de5c918280ead70d3e51fabd531b01eb4f8c6af4..91fde066f156ec43d4f4c17370aec7e4dc3cf4fe 100644 (file)
@@ -982,7 +982,7 @@ DEFUN (no_debug_ospf_ism,
 
   if (inst) // user passed instance ID
   {
-    if (!ospf_lookup_instance (strtoul (argv[2]->arg, NULL, 10)))
+    if (!ospf_lookup_instance (strtoul (inst, NULL, 10)))
       return CMD_SUCCESS;
   }
 
@@ -1057,7 +1057,7 @@ debug_ospf_nsm_common (struct vty *vty, int arg_base, int argc, struct cmd_token
 
 DEFUN (debug_ospf_nsm,
        debug_ospf_nsm_cmd,
-       "debug ospf nsm [status|events|timers]",
+       "debug ospf nsm [<status|events|timers>]",
        DEBUG_STR
        OSPF_STR
        "OSPF Neighbor State Machine\n"
@@ -1070,7 +1070,7 @@ DEFUN (debug_ospf_nsm,
 
 DEFUN (debug_ospf_instance_nsm,
        debug_ospf_instance_nsm_cmd,
-       "debug ospf (1-65535) nsm [status|events|timers]",
+       "debug ospf (1-65535) nsm [<status|events|timers>]",
        DEBUG_STR
        OSPF_STR
        "Instance ID\n"
@@ -1128,7 +1128,7 @@ no_debug_ospf_nsm_common (struct vty *vty, int arg_base, int argc, struct cmd_to
 
 DEFUN (no_debug_ospf_nsm,
        no_debug_ospf_nsm_cmd,
-       "no debug ospf nsm [status|events|timers]",
+       "no debug ospf nsm [<status|events|timers>]",
        NO_STR
        DEBUG_STR
        OSPF_STR
@@ -1143,7 +1143,7 @@ DEFUN (no_debug_ospf_nsm,
 
 DEFUN (no_debug_ospf_instance_nsm,
        no_debug_ospf_instance_nsm_cmd,
-       "no debug ospf (1-65535) nsm [status|events|timers]",
+       "no debug ospf (1-65535) nsm [<status|events|timers>]",
        NO_STR
        DEBUG_STR
        OSPF_STR
@@ -1206,7 +1206,7 @@ debug_ospf_lsa_common (struct vty *vty, int arg_base, int argc, struct cmd_token
 
 DEFUN (debug_ospf_lsa,
        debug_ospf_lsa_cmd,
-       "debug ospf lsa [generate|flooding|install|refresh]",
+       "debug ospf lsa [<generate|flooding|install|refresh>]",
        DEBUG_STR
        OSPF_STR
        "OSPF Link State Advertisement\n"
@@ -1220,7 +1220,7 @@ DEFUN (debug_ospf_lsa,
 
 DEFUN (debug_ospf_instance_lsa,
        debug_ospf_instance_lsa_cmd,
-       "debug ospf (1-65535) lsa [generate|flooding|install|refresh]",
+       "debug ospf (1-65535) lsa [<generate|flooding|install|refresh>]",
        DEBUG_STR
        OSPF_STR
        "Instance ID\n"
@@ -1283,7 +1283,7 @@ no_debug_ospf_lsa_common (struct vty *vty, int arg_base, int argc, struct cmd_to
 
 DEFUN (no_debug_ospf_lsa,
        no_debug_ospf_lsa_cmd,
-       "no debug ospf lsa [generate|flooding|install|refresh]",
+       "no debug ospf lsa [<generate|flooding|install|refresh>]",
        NO_STR
        DEBUG_STR
        OSPF_STR
@@ -1298,7 +1298,7 @@ DEFUN (no_debug_ospf_lsa,
 
 DEFUN (no_debug_ospf_instance_lsa,
        no_debug_ospf_instance_lsa_cmd,
-       "no debug ospf (1-65535) lsa [generate|flooding|install|refresh]",
+       "no debug ospf (1-65535) lsa [<generate|flooding|install|refresh>]",
        NO_STR
        DEBUG_STR
        OSPF_STR
@@ -1354,7 +1354,7 @@ debug_ospf_zebra_common (struct vty *vty, int arg_base, int argc, struct cmd_tok
 
 DEFUN (debug_ospf_zebra,
        debug_ospf_zebra_cmd,
-       "debug ospf zebra [interface|redistribute]",
+       "debug ospf zebra [<interface|redistribute>]",
        DEBUG_STR
        OSPF_STR
        "OSPF Zebra information\n"
@@ -1366,7 +1366,7 @@ DEFUN (debug_ospf_zebra,
 
 DEFUN (debug_ospf_instance_zebra,
        debug_ospf_instance_zebra_cmd,
-       "debug ospf (1-65535) zebra [interface|redistribute]",
+       "debug ospf (1-65535) zebra [<interface|redistribute>]",
        DEBUG_STR
        OSPF_STR
        "Instance ID\n"
@@ -1420,7 +1420,7 @@ no_debug_ospf_zebra_common(struct vty *vty, int arg_base, int argc,
 
 DEFUN (no_debug_ospf_zebra,
        no_debug_ospf_zebra_cmd,
-       "no debug ospf zebra [interface|redistribute]",
+       "no debug ospf zebra [<interface|redistribute>]",
        NO_STR
        DEBUG_STR
        OSPF_STR
@@ -1433,7 +1433,7 @@ DEFUN (no_debug_ospf_zebra,
 
 DEFUN (no_debug_ospf_instance_zebra,
        no_debug_ospf_instance_zebra_cmd,
-       "no debug ospf (1-65535) zebra [interface|redistribute]",
+       "no debug ospf (1-65535) zebra [<interface|redistribute>]",
        NO_STR
        DEBUG_STR
        OSPF_STR
index d6686399c2e5b5e7684c08dfe87f15d78cb7f487..95fadde95278d93665cc31a3a85e1f18d9348651 100644 (file)
@@ -1400,7 +1400,7 @@ DEFUN (ip_rip_receive_version_2,
 
 DEFUN (no_ip_rip_receive_version,
        no_ip_rip_receive_version_cmd,
-       "no ip rip receive version [(1-1)|(2-2)]",
+       "no ip rip receive version [<1|2>]",
        NO_STR
        IP_STR
        "Routing Information Protocol\n"
@@ -1495,7 +1495,7 @@ DEFUN (ip_rip_send_version_2,
 
 DEFUN (no_ip_rip_send_version,
        no_ip_rip_send_version_cmd,
-       "no ip rip send version [(1-1)|(2-2)]",
+       "no ip rip send version [<1|2>]",
        NO_STR
        IP_STR
        "Routing Information Protocol\n"
index 02e7bac68f4ef52eefd8941ba393165dbf4ebb0d..af88475d2129229a5bf5b4ecfd87247903514d8e 100755 (executable)
@@ -684,9 +684,26 @@ DEFUN (no_bgp_maxmed_onstartup,
         if not line.endswith('\n'):
             line += '\n'
 
+        if '|<' in line:
+            print "%d: ERROR |< is illegal in '%s'" % (self.line_number, line)
+
+        if '|[' in line:
+            print "%d: ERROR |[ is illegal in '%s'" % (self.line_number, line)
+
         # compress duplicate whitespaces
         re_space = re.search('^(\s*).*(\s*)$', line)
         line = re_space.group(1) + ' '.join(line.split()) + re_space.group(2)
+
+        for token in line_to_tokens(self.line_number, line):
+            token = token.strip()
+
+            if token.endswith('",'):
+                token = token[0:-2]
+
+            if token.startswith('[') and '|' in token:
+                if not token.startswith('[<') or not token.endswith('>]'):
+                    print "%s: suspend token '%s'" % (self.line_number, token)
+
         return line
 
     def get_used_idx_variables(self, idx_table):
@@ -743,8 +760,9 @@ DEFUN (no_bgp_maxmed_onstartup,
         return False
 
     def dump(self):
-        new_command_string = self.get_new_command_string()
-        new_command_string_expanded = expand_command_string(new_command_string)
+        # new_command_string = self.get_new_command_string()
+        # new_command_string_expanded = expand_command_string(new_command_string)
+        new_command_string_expanded = self.get_new_command_string()
         lines = []
 
         lines.append("DEFUN (%s,\n" % self.name)
@@ -898,7 +916,6 @@ def update_argvs(filename):
                     state = None
                     fh.write(line)
                 elif line.strip().startswith('* ') and not line.strip().startswith('*    '):
-                    # dwalton
                     new_line = expand_command_string(line[3:]) # chop the leading " * "
                     fh.write(" * %s" % new_line)
                 else:
index 3714ffe3f68a567290ff3cb24bc9df05b253ea91..6acf32b43daecfbfc9e9febb9de89aa23a1db8f3 100644 (file)
@@ -174,7 +174,7 @@ DEFUN (debug_zebra_kernel,
 
 DEFUN (debug_zebra_kernel_msgdump,
        debug_zebra_kernel_msgdump_cmd,
-       "debug zebra kernel msgdump [recv|send]",
+       "debug zebra kernel msgdump [<recv|send>]",
        DEBUG_STR
        "Zebra configuration\n"
        "Debug option set for zebra between kernel interface\n"
@@ -292,7 +292,7 @@ DEFUN (no_debug_zebra_kernel,
 
 DEFUN (no_debug_zebra_kernel_msgdump,
        no_debug_zebra_kernel_msgdump_cmd,
-       "no debug zebra kernel msgdump [recv|send]",
+       "no debug zebra kernel msgdump [<recv|send>]",
        DEBUG_STR
        "Zebra configuration\n"
        "Debug option set for zebra between kernel interface\n"
index e6e7f5d2eac2f42538a02d2a85a9c6351a885722..7f1a042f56dbc1e02804376de58ce7cc2490036f 100644 (file)
@@ -208,9 +208,9 @@ DEFUN (no_ip_mroute_dist,
        "Nexthop interface name\n"
        "Distance\n")
 {
-  char *destprefix = argv[2]->arg;
-  char *nexthop = argv[3]->arg;
-  char *distance = (argc == 5) ? argv[4]->arg : NULL;
+  char *destprefix = argv[3]->arg;
+  char *nexthop = argv[4]->arg;
+  char *distance = (argc == 6) ? argv[5]->arg : NULL;
 
   return zebra_static_ipv4 (vty, SAFI_MULTICAST, 0, destprefix, NULL, nexthop, NULL, NULL, distance, NULL);
 }
@@ -1392,6 +1392,9 @@ DEFUN (show_ip_route_tag,
        "Show only routes with tag\n"
        "Tag value\n")
 {
+  int idx_vrf = 3;
+  int idx_name = 4;
+  int idx_tag = 6;
   struct route_table *table;
   struct route_node *rn;
   struct rib *rib;
@@ -1399,14 +1402,15 @@ DEFUN (show_ip_route_tag,
   u_short tag = 0;
   vrf_id_t vrf_id = VRF_DEFAULT;
  
-  if (strmatch(argv[3]->text, "vrf"))
+  if (strmatch(argv[idx_vrf]->text, "vrf"))
     {
-      VRF_GET_ID (vrf_id, argv[4]->arg);
-      tag = atoi(argv[6]->arg);
+      VRF_GET_ID (vrf_id, argv[idx_name]->arg);
+      tag = atoi(argv[idx_tag]->arg);
     }
   else
     {
-      tag = atoi(argv[4]->arg);
+      idx_tag -= 2;
+      tag = atoi(argv[idx_tag]->arg);
     }
 
   table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
@@ -2852,6 +2856,9 @@ DEFUN (show_ipv6_route_tag,
        "Show only routes with tag\n"
        "Tag value\n")
 {
+  int idx_vrf = 3;
+  int idx_name = 4;
+  int idx_tag = 6;
   struct route_table *table;
   struct route_node *rn;
   struct rib *rib;
@@ -2859,14 +2866,15 @@ DEFUN (show_ipv6_route_tag,
   u_short tag = 0;
   vrf_id_t vrf_id = VRF_DEFAULT;
 
-  if (strmatch(argv[3]->text, "vrf"))
+  if (strmatch(argv[idx_vrf]->text, "vrf"))
     {
-      VRF_GET_ID (vrf_id, argv[4]->arg);
-      tag = atoi(argv[6]->arg);
+      VRF_GET_ID (vrf_id, argv[idx_name]->arg);
+      tag = atoi(argv[idx_tag]->arg);
     }
   else
     {
-      tag = atoi(argv[4]->arg);
+      idx_tag -= 2;
+      tag = atoi(argv[idx_tag]->arg);
     }
 
   table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
@@ -3352,6 +3360,7 @@ DEFUN (show_ipv6_route_vrf_all_protocol,
        VRF_ALL_CMD_HELP_STR
        QUAGGA_IP6_REDIST_HELP_STR_ZEBRA)
 {
+  int idx_protocol = 5;
   int type;
   struct route_table *table;
   struct route_node *rn;
@@ -3361,7 +3370,7 @@ DEFUN (show_ipv6_route_vrf_all_protocol,
   int first = 1;
   int vrf_header = 1;
 
-  type = proto_redistnum (AFI_IP6, argv[4]->arg);
+  type = proto_redistnum (AFI_IP6, argv[idx_protocol]->arg);
   if (type < 0)
     {
       vty_out (vty, "Unknown route type%s", VTY_NEWLINE);