Paul,

See below.

On 6/15/2016 5:53 AM, Paul Jakma wrote:
> On Tue, 12 Jan 2016, Lou Berger wrote:
>
>> +DEFUN (show_commandtree,
>> +       show_commandtree_cmd,
>> +       "show commandtree",
>> +       NO_STR
>> +       "Show command tree\n")
>> +{
>> +  /* TBD */
>> +  vector cmd_vector;
>> +  unsigned int i;
>> +
>> +  vty_out (vty, "Current node id: %d%s", vty->node, VTY_NEWLINE);
>> +
>> +  /* vector of all commands installed at this node */
>> +  cmd_vector = vector_copy (cmd_node_vector (cmdvec, vty->node));
>> +
>> +  /* loop over all commands at this node */
>> +  for (i = 0; i < vector_active(cmd_vector); ++i)
>> +    {
>> +      struct cmd_element *cmd_element;
>> +
>> +      /* A cmd_element (seems to be) is an individual command */
>> +      if ((cmd_element = vector_slot (cmd_vector, i)) == NULL)
>> +        continue;
>> +
>> +      vty_out (vty, "    %s%s", cmd_element->string, VTY_NEWLINE);
>> +    }
>
> How does this 'show commandtree' differ from the long standing 'list' 
> command? The body of that is:
>
>    for (i = 0; i < vector_active (cnode->cmd_vector); i++)
>      if ((cmd = vector_slot (cnode->cmd_vector, i)) != NULL
>          && !(cmd->attr == CMD_ATTR_DEPRECATED
>               || cmd->attr == CMD_ATTR_HIDDEN))
>        vty_out (vty, "  %s%s", cmd->string,
>                 VTY_NEWLINE);
>
> Other than ignoring hidden ones - 
That's it.  The main usage was ensuring we didn't loose *anything* when
doing some major CLI reorg/hacking...

> which could be made an option of the 
> existing 'list'?
True.

> Do we need this new command?
I think skipping this for now is fine and if the need once again arises
for showing all, we can add it as a list option.

Thanks,
Lou

> regards,



_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to