<p>In <a href="https://github.com/mlpack/mlpack/pull/680#discussion_r66188168">src/mlpack/core/util/cli_impl.hpp</a>:</p>
<pre style='color:#555'>&gt;                const std::string&amp; description,
&gt;                const std::string&amp; alias,
&gt;                bool required)
&gt;  {
&gt; +  // Temporary outstream object for detecting duplicate identifiers
&gt; +  util::PrefixedOutStream outstr(std::cerr,
&gt; +        BASH_RED &quot;[FATAL] &quot; BASH_CLEAR, false, true /* fatal */);
&gt; +
&gt; +  // identifier and alias maps
&gt; +  gmap_t&amp; gmap = GetSingleton().globalValues;
&gt; +  amap_t&amp; amap = GetSingleton().aliasValues;
&gt; +
&gt; +  // if found in current map, print fatal error and terminat program.
&gt; +  if (gmap.count(identifier))
&gt; +    outstr &lt;&lt; &quot;Parameter --&quot; &lt;&lt; identifier &lt;&lt; &quot;(-&quot; &lt;&lt; alias &lt;&lt; &quot;) &quot;
&gt; +           &lt;&lt; &quot;is defined multiple times with same identifiers.&quot; &lt;&lt; std::endl;
&gt; +  if (amap.count(alias))
&gt; +    outstr &lt;&lt; &quot;Parameter --&quot; &lt;&lt; identifier &lt;&lt; &quot;(-&quot; &lt;&lt; alias &lt;&lt; &quot;) &quot;
&gt; +           &lt;&lt; &quot;is defined multiple times with same alias.&quot; &lt;&lt; std::endl;
</pre>
<p>This is a good way to solve the problem of duplicate options, I like it.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/680/files/92f3cd11d129367ba1b48d79b3081409ae80707a#r66188168">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFPWqdETWzwaaNSnXgS17bT900dpbks5qJjgbgaJpZM4Iu0EJ">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFOkutfxQplrzAPeVSGW3VhoBUAdPks5qJjgbgaJpZM4Iu0EJ.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/680/files/92f3cd11d129367ba1b48d79b3081409ae80707a#r66188168"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>