[racket] What is racket/cmdline?

From: Danny Yoo (dyoo at hashcollision.org)
Date: Tue Apr 9 13:37:34 EDT 2013

Deepak, please place a useful subject line on your emails.  Right now,
your emails have no subject line, which makes it difficult for people
to judge whether or not the question is interesting to them.  I'm
changing the subject line to "What is cmdline?".

---

It's a bit hard to answer this question without you telling us some
background on what you already know.  Are you already familiar with
the command-line interface of certain operating systems, or are you
only familiar with a graphical user interface?


If there's a function you don't quite know, DrRacket provides fairly
extensive documentation if you use your mouse and right-click the name
of the function.

In this case, command-line has documentation here:

    http://docs.racket-lang.org/reference/Command-Line_Parsing.html

It's a library to manage some of the messiness of parsing command line
arguments to a program.  When a program is executed from the command
line (http://docs.racket-lang.org/guide/scripts.html), the user can
provide additional command line arguments to provide initial inputs
into the program.


These arguments are passed as a parameter to the program,
current-command-line-arguments,

    http://docs.racket-lang.org/reference/runtime.html#%28def._%28%28quote._~23~25kernel%29._current-command-line-arguments%29%29

but we would like to deal with that vector of strings in a way
consistent with other command-line tools.  e.g. provide a good
"--help", print good error messages when the user passes bad
arguments, etc.  The racket/cmdline library, and the command-line
function that it provides, are tools to help make these convenient to
implement.

Posted on the users mailing list.