CLI debugging

Pavel TvrdĂ­k pavel.tvrdik at nic.cz
Mon Sep 5 12:34:55 CEST 2016


Hi.

On 2016-09-02 13:59, Israel G. Lugo wrote:
> On 08/30/2016 02:01 PM, Bernardo Figueiredo wrote:
>> In my opinion:
>> debug (<protocol> | <pattern> | all) (all | off | ( "{" states | 
>> routes
>> | filters | interfaces | events | packets "}" ) )  Control protocol
>> debugging via BIRD logs
>> 
>> The parethensis are to group all the various options and the "{" and 
>> "}"
>> is so it's clearer that we must write { and }.
> 
> 
> I think that explanation is better than the current one. However, it 
> may
> not play well with the CF_CLI macro that defines the grammar from the
> explanation (in nest/config.Y).
> 
> Forgetting about the macro for a moment, I think we can still do a
> better explanation. The | here to me indicates a choice, e.g. "either
> states or routes or filters", but in reality the user can combine these
> flags.
> 
> We need something that can say "one or more of: states, routes, 
> filters,
> interfaces, events, packets". It's hard to say this in a single line
> without cluttering everything, though...
> 
> If we had more space, we could do something like:
> 
> debug (<protocol> | <pattern> | all) (all | off | "{" DEBUG_FLAG, [
> DEBUG_FLAG, ... ] "}" ) )  Control protocol debugging via BIRD logs
>   Available DEBUG_FLAGs: states, routes, filters, interfaces, events, 
> packets
> 
> Of course, this isn't consistent with the remaining help explanations.
> Not to mention we'd need a different CF_CLI* macro.
> 
> Does anyone have a better idea?
> 

I found out that <pattern> should be in quotes too. It should be 
"<pattern>" like for "bgp*". I've made a git branch 'cli-debugging' with 
a variant (39a7bce):

bird> debug ?
debug (<protocol> | "<pattern>" | all) (all | off | "{" <flag1> [, 
<flag2> ...] "}")  Control protocol debugging via BIRD logs
   Available flags: states, routes, filters, interfaces, events, packets

In my opinion, the quotes by "<pattern>", "{" and "}" is confusing too. 
And a comma should be probably quoted too in this case. New line before 
available flags is possible but inconsistent.

What do you think about this (276a639)?

bird> debug ?
debug (<protocol> | "<pattern>" | all) (all | off | {<flag1> [, <flag2> 
...]})  Control protocol debugging via BIRD logs, available flags: 
states, routes, filters, interfaces, events, packets


Thanks to all for propositions!
Pavel


More information about the Bird-users mailing list