[plt-scheme] Command Line Processing

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Jun 22 08:27:51 EDT 2009

At Fri, 19 Jun 2009 09:53:57 -0600, Doug Williams wrote:
> What is the best way to test programs using command-line during development?
> It seems I'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.

In the details part of the "Choose Language..." dialog, DrScheme lets
you set a command line for running the program. So that's one way to
test in the sense of "experiment".

More often, my programs are either

 * mostly in a library, and the executable is a thin wrapper to parse
   command-line flags, so I mostly experiment (or really test) by using
   the library directly; or

 * small scripts where I just change the program depending on whether I
   run it in DrScheme or from a command line.

It does seem like there should be a better way.



Posted on the users mailing list.