<html><body bgcolor="#FFFFFF"><div><br><br>On Aug 7, 2010, at 4:22 PM, Andrei Alexandrescu &lt;<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div><span>On 08/07/2010 05:55 PM, Adrian Matoga wrote:</span><br><blockquote type="cite"><span>Hi,</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Is it by design that single-letter option needs to be glued to its</span><br></blockquote><blockquote type="cite"><span>argument, like "-ofilename", or is it a bug in implementation?</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Source:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>import std.stdio;</span><br></blockquote><blockquote type="cite"><span>import std.getopt;</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>void main(string[] args)</span><br></blockquote><blockquote type="cite"><span>{</span><br></blockquote><blockquote type="cite"><span>string outputFile;</span><br></blockquote><blockquote type="cite"><span>getopt(args,</span><br></blockquote><blockquote type="cite"><span>config.passThrough,</span><br></blockquote><blockquote type="cite"><span>"o|output-filename", &amp;outputFile);</span><br></blockquote><blockquote type="cite"><span>writeln(args);</span><br></blockquote><blockquote type="cite"><span>writeln("'" ~ outputFile ~ "'");</span><br></blockquote><blockquote type="cite"><span>}</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Results:</span><br></blockquote><blockquote type="cite"><span> &gt;test.exe -o somename</span><br></blockquote><blockquote type="cite"><span>test.exe somename</span><br></blockquote><blockquote type="cite"><span>''</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> &gt;test.exe -osomename</span><br></blockquote><blockquote type="cite"><span>test.exe</span><br></blockquote><blockquote type="cite"><span>'somename'</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Regards,</span><br></blockquote><blockquote type="cite"><span>Adrian Matoga</span><br></blockquote><span></span><br><span>It's by design in order to avoid confusion with parameterless options. Your example works with either of these invocations:</span><br><span></span><br><span>./prog -ofilename</span><br><span>./prog -o=filename</span><br><span>./prog --o=filename</span><br><span></span><br><span>but not others.</span><br><span></span><br><span></span><br><span>Andrei</span><br><span></span><br></div></blockquote><br><span class="Apple-style-span" style="font-size: 13px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><span>The prevailing convention is to&nbsp;</span><span>allow whitespace in this case. &nbsp;Would you reconsider?</span><br><span></span><br><span>Sorry for the accidental null post earlier.</span><br><span></span><br><span>-steve</span></span></body></html>