<p>Kevin Harwell <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/17677">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app.c: Throw warnings for nonexistent options<br><br>Currently, Asterisk doesn't throw warnings if options<br>are passed into applications that don't accept them.<br>This can confuse users if they're unaware that they<br>are doing something wrong.<br><br>This adds an additional check to parse_options so that<br>a warning is thrown anytime an option is parsed that<br>doesn't exist in the parsing application, so that users<br>are notified of the invalid usage.<br><br>ASTERISK-29801 #close<br><br>Change-Id: Id029274a57135caca193c913307a63fd75e24679<br>---<br>M main/app.c<br>1 file changed, 3 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/app.c b/main/app.c</span><br><span>index c20e370..5be8457 100644</span><br><span>--- a/main/app.c</span><br><span>+++ b/main/app.c</span><br><span>@@ -2937,6 +2937,9 @@</span><br><span> } else if (argloc) {</span><br><span> args[argloc - 1] = "";</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!options[curarg].flag) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_WARNING, "Unrecognized option: '%c'\n", curarg);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> if (flaglen == 32) {</span><br><span> ast_set_flag(flags, options[curarg].flag);</span><br><span> } else {</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/17677">change 17677</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.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.asterisk.org/c/asterisk/+/17677"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: Id029274a57135caca193c913307a63fd75e24679 </div>
<div style="display:none"> Gerrit-Change-Number: 17677 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>