I am writing an application that uses command-line (from scheme/cmdline) to parse command line arguments. Consider the following simple test-app.ss program:<br><br>#lang scheme<br><br>(define verbose-mode (make-parameter #f))<br>
<br>(define input-file (make-parameter &quot;input.xml&quot;))<br><br>(define output-directory (make-parameter &quot;output&quot;))<br><br>(command-line<br> #:program &quot;test-app&quot;<br> #:once-each<br> [(&quot;-v&quot; &quot;--verbose&quot;) &quot;Generate with verbose messages&quot;<br>
                     (verbose-mode #t)]<br> [(&quot;-i&quot; &quot;--input-file&quot;) if<br>                        &quot;Input file&quot;<br>                        (input-file if)]<br> [(&quot;-o&quot; &quot;--output-directory&quot;) od<br>
                              &quot;Output directory&quot;<br>                              (output-directory od)]<br> #:args () (void))<br><br>(printf &quot;Test Command-Line Application~n&quot;)<br>(printf &quot;  verbose-mode = ~a~n&quot; (verbose-mode))<br>
(printf &quot;  input-file = ~s~n&quot; (input-file))<br>(printf &quot;  output-directory = ~s~n&quot; (output-directory))<br><br>When I make an executable of this using Scheme&gt;Create Executable ... and select Stand-alone and MzScheme, I can get it to work, but I have some questions.<br>
<br>Why do I need &quot;--&quot; before my arguments? [They seem to be parsed by MzScheme if I don&#39;t.]<br><br>For example:<br><br>&gt;test-app -v<br>Welcome to MzScheme v4.2 [3m], Copyright (c) 2004-2009 PLT Scheme Inc.<br>
Test Command-Line Application<br>  verbose-mode = #f<br>  input-file = &quot;input.xml&quot;<br>  output-directory = &quot;output&quot;<br><br>I get the MzScheme banner and my application doesn&#39;t see the &quot;-v&quot;. So presumable, MzScheme parsed it.<br>
<br>&gt;test-app -- -v<br>Test Command-Line Application<br>  verbose-mode = #t<br>  input-file = &quot;input.xml&quot;<br>  output-directory = &quot;output&quot;<br><br>Works as expected.<br><br>Is there any way to get this behavior without the &quot;--&quot;? Should I be using mzc to compile it instead of DrScheme?<br>
<br>It seems to work as expected if I select Launcher when using Scheme&gt;Create Executable ....<br><br>What is the best way to test programs using command-line during development? It seems I&#39;d like to be able to tell if I am NOT being executed from the command line and do some alternate processing in that case - either use the defaults or use current-command-line-arguments to set specific values and let command-line parse those.<br>
<br>Any help/thoughts would be welcome.<br><br>Thanks,<br>Doug<br>