vty: show asciidoc counters: don't create an empty table for osmo_counters

When creating asciidocs for osmo_counter an empty is not useful.
If there aren't any counter, output a hidden comment
Change-Id: Ie2768100e69dcd7d8d77533688585dd9b43c4a5e
This commit is contained in:
Alexander Couzens 2017-12-05 16:12:14 +01:00
parent 18ba26cfab
commit 06dbdf59eb
1 changed files with 7 additions and 0 deletions

View File

@ -393,6 +393,13 @@ static int asciidoc_handle_counter(struct osmo_counter *counter, void *sctx_)
static void asciidoc_counter_generate(struct vty *vty)
{
if (osmo_counters_count() == 0)
{
vty_out(vty, "// there are no ungrouped osmo_counters%s",
VTY_NEWLINE);
return;
}
vty_out(vty, "// ungrouped osmo_counters%s", VTY_NEWLINE);
vty_out(vty, ".ungrouped osmo counters%s", VTY_NEWLINE);
vty_out(vty, "[options=\"header\"]%s", VTY_NEWLINE);