osmo-pcu[master]: vty: add commands to show TBF of a certain kind

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Feb 5 13:24:47 UTC 2018

Patch Set 2:

> > Could be one command with (all|pacch|...)
 > Sure. What would be advantage of such approach? In case of separate
 > commands it's trivial 1-liner functions. If we use single command
 > with parameters than we have to check for parameter value using
 > switch or if ladder.

A signle command with !strmcp if-clauses is more in line to what we have at many other places in the code.  At least those instances of VTY code that I wrote or I can remember implement the previous approach.  I think ultimately, you end up with less lines.  But then I agree, it's not a blocking issue, which is why I wrote "could".

Also, note the replication of things like
SHOW_STR "information about TBFs\n

in your approach, where actually you should add a #define like TBF_STR and then re-use that.  If you go for a single DEFUN this comes for free.

Also, if one later e.g. introduces something like an optional [stats] argument or whatever other argument to show more information, a single function would be easier to change, than multiple.

To view, visit https://gerrit.osmocom.org/6239
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-HasComments: No

More information about the gerrit-log mailing list