<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/20473">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">vty: fix vty_dump_element(): do not print empty <attributes><br><br>Some attributes like CMD_ATTR_LIB_COMMAND are not being printed<br>to the XML VTY reference (despite being set), so we should not<br>print empty "<attributes scope='global'></attributes>".<br><br>Change-Id: Ie7e53b080c10564bfef6f0e8ddeb470e46fad387<br>Related: SYS#4937<br>---<br>M src/vty/command.c<br>1 file changed, 5 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/20473/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/vty/command.c b/src/vty/command.c</span><br><span>index 29d823e..fd5c045 100644</span><br><span>--- a/src/vty/command.c</span><br><span>+++ b/src/vty/command.c</span><br><span>@@ -631,6 +631,10 @@</span><br><span>   { 0, NULL }</span><br><span> };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Public attributes (to be printed in the VTY / XML reference) */</span><br><span style="color: hsl(120, 100%, 40%);">+#define CMD_ATTR_PUBLIC_MASK \</span><br><span style="color: hsl(120, 100%, 40%);">+     (CMD_ATTR_IMMEDIATE | CMD_ATTR_NODE_EXIT)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Get a flag character for a global VTY command attribute */</span><br><span> static char cmd_attr_get_flag(unsigned int attr)</span><br><span> {</span><br><span>@@ -670,7 +674,7 @@</span><br><span>  print_func(data, "    <command id='%s'>%s", xml_string, newline);</span><br><span> </span><br><span>        /* Print global attributes and their description */</span><br><span style="color: hsl(0, 100%, 40%);">-     if (cmd->attr != 0x00) { /* ... if at least one flag is set */</span><br><span style="color: hsl(120, 100%, 40%);">+     if (cmd->attr & CMD_ATTR_PUBLIC_MASK) { /* ... only public ones */</span><br><span>            print_func(data, "      <attributes scope='global'>%s", newline);</span><br><span> </span><br><span>                for (i = 0; i < ARRAY_SIZE(cmd_attr_desc) - 1; i++) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/20473">change 20473</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/20473"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie7e53b080c10564bfef6f0e8ddeb470e46fad387 </div>
<div style="display:none"> Gerrit-Change-Number: 20473 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>