<p style="white-space: pre-wrap; word-wrap: break-word;">So I'm happy with adding this new function, but I'm worried about the explanation given in the commitlog and your plan to fix this on the callback side of every VTY function rather than in the libosmovty core.</p><p><a href="https://gerrit.osmocom.org/13394">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/13394/1//COMMIT_MSG">Commit Message:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13394/1//COMMIT_MSG@20">Patch Set #1, Line 20:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><br>One could expect the VTY to then pass the unambiguous match of "apples" to the<br>parsing function, but that is not the case.<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">why not "simply" change the VTY internals to adjust its behavior around our existing assumptions?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13394/1//COMMIT_MSG@24">Patch Set #1, Line 24:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Hence a VTY function implementation is faced with parsing a keyword of "app"<br>instead of the expected "apples".<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">that's *really* unexpected and odd.  It should definitely be fixed inside the VTY library and not in applications.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13394/1//COMMIT_MSG@28">Patch Set #1, Line 28:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">I am now writing new<br>commands in a way that are able to manage only the starts of keywords<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Please don't.  Let's rather fix it once in the parser.  If the parser matches "app" against "apples" but then passes "app" into the function, it may very well pass "apples" instead and make everyone happy, including the hundreds of existing functions.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Alternatively, we may simply requrie the user to pres "tab" until the full keyword is entered.  That's how I've used Osmocom VTYs during the past decade.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13394/1//COMMIT_MSG@31">Patch Set #1, Line 31:</a> <code style="font-family:monospace,monospace">Arguably, strstr(a, b) == a does the same thing, but it searches the entire</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Why is that a problem exactly? Why do we need in our API smth which duplicates <string. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">see the code. Because strstr would also match strings at other offsets than 0, massively increasing the required CPU to compute something we're not interested in anyway.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/13394">change 13394</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/13394"/><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-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Ib2ffb0e9a870dd52e081c7e66d8818057d159513 </div>
<div style="display:none"> Gerrit-Change-Number: 13394 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 27 Mar 2019 07:48:38 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>