Opened 9 years ago

Closed 9 years ago

#854 closed enhancement (fixed)

Cannot pass command line arguments to CCL script

Reported by: mcandre Owned by:
Priority: normal Milestone:
Component: Documentation Version: trunk
Keywords: command line arguments options flags Cc:


I'm trying to rewrite a shebang in a CLISP script for CCL.

exec clisp -q -q $0 $0 ${1+"$@"}
exec ccl -Q -l $0 $0 ${1+"$@"}

But when I try to run my script, CCL interprets the script's arguments as CCL arguments.

$ ./problem.lisp --code "Hey" --jeer "Yo" ~/Downloads/problem.png
Unknown option: --code
usage: dx86cl64 <options>
	 or dx86cl64 <image-name>
	 where <options> are one or more of:
        -h, --help : this text
        -V, --version : print (LISP-IMPLEMENTATION-VERSION) and exit
        -K, --terminal-encoding : specify character encoding to use for *TERMINAL-IO*
        -n, --no-init : suppress loading of init file
        -e, --eval : evaluate <form> (may need to quote <form> in shell)
        -l, --load : load <file>
        -T, --set-lisp-heap-gc-threshold : set lisp-heap-gc-threshold to <n>
        -Q, --quiet : if --batch, also suppress printing of heralds, prompts
	-R, --heap-reserve <n>: reserve <n> (default: 549755813888)
		 bytes for heap expansion
	-S, --stack-size <n>: set  size of initial thread's control stack to <n>
	-Z, --thread-stack-size <n>: set default size of first (listener)  thread's stacks based on <n>
	-b, --batch: exit when EOF on *STANDARD-INPUT*
	--no-sigtrap : obscure option for running under GDB
	-I, --image-name <image-name>
	 and <image-name> defaults to dx86cl64.image

Change History (3)

comment:1 Changed 9 years ago by rme

  • Component changed from IDE to Documentation
  • Resolution set to fixed
  • Status changed from new to closed

You probably want the "--" argument. Any subsequent arguments are ignored by the lisp kernel.

r14729 and r14730 document this in the help message and the manual, respectively.

comment:2 Changed 9 years ago by mcandre

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Type changed from defect to enhancement

Ah, thanks.

Could -- be described in the usage info ( ccl --help ) so that other newbies like me can quickly discover the option?

comment:3 Changed 9 years ago by rme

  • Resolution set to fixed
  • Status changed from reopened to closed

Yes, as mentioned, r14729 (in the trunk) describes the -- option in the --help message.

If you're running the trunk, do svn up and then rebuild the lisp with (rebuild-ccl :full t). After that, --help does as you suggest.

Thanks for the report; we definitely should have been mentioning the -- option

Note: See TracTickets for help on using tickets.