[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: command line arguments

Joachim Schrod <schrod@iti.informatik.th-darmstadt.de> asks:

> Are the command line arguments available in CLISP?

No, because command line arguments are not reasonably portable across
all platforms supported by CLISP. (DOS and Atari TOS limit the command
line length to 128 and 80 characters, respectively, making it unusable
for "real" applications.) Furthermore, passing quotes and double quotes
within command line arguments is always a pain and depends on the command
line interpreter.

If you are on Unix, you can use the -x option to pass information.
For example, to pass the strings "foo" and "bar", you can use the following
command line:

clisp -x '(progn (setq *args* (quote ("foo" "bar"))) (setq *standard-input* (setq *query-io* (make-synonym-stream (quote *terminal-io*)))) (values))'

You might modify the `clisp' shell script appropriately.

> Actually I would like to have some symbol (say, in package SYSTEM)
> that is bound to a list of strings; the arguments that are not already
> processed by CLISP itself.

This would be dangerous since we don't know which command line options
will be added to CLISP in the future.

                    Bruno Haible