<blockquote>
<p>If GOptionParser chokes on a single - (does it? I figured it would just pass it through), some code could be added to detect/remove - from argv before calling into the option parser, instead of dealing with it after the option parser.</p>
</blockquote>

<p>Ahhh, I was looking at the <code>g_option</code> API that won't let you specify a <code>-</code> by itself as an option, but you are right it passes it through, and geany opens a new file called <code>-</code>,  and <code>--</code> also passes through too even though it is documented as "stop parsing options", so it needs filtering as well.</p>

<blockquote>
<p>Good point, it would probably need to detect, and convert from the terminal encoding, which may not be UTF-8.</p>
</blockquote>

<p>The problem is that the output of the command may not be in terminal encoding either, it has to be selectable manually <code>--encoding=xxx</code> maybe, but that is of course more effort for the "somebody" implementing this capability.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/issues/780#issuecomment-160241771">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJyJv120e2Uv5X0_BDGn23BRaG8a5ks5pKQkLgaJpZM4GqokY.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/geany/geany/issues/780#issuecomment-160241771"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>