dnaeon / clingon

Command-line options parser system for Common Lisp
Other
122 stars 7 forks source link

Documentation request #21

Closed rpgoldman closed 7 months ago

rpgoldman commented 7 months ago

Could you explain how one can have positional arguments as well as option arguments? Or, if it is impossible to handle positional arguments with clingon, please let me know?

In most such frameworks one invokes a parsing procedure, and then can use the unprocessed arguments as the positional arguments, but with clingon, it's not clear when the arguments are processed and how to address the remaining ones.

It may be that this cannot be done: we might need to track the unprocessed parts of the command line and return them as additional values from parse-command-line. I was looking for some slot on the command that held remaining (positional) arguments, but I don't see anything.

I'm not sure what free-arguments are -- maybe that's what I am looking for?

dnaeon commented 7 months ago

Hey @rpgoldman ,

I think you need to use CLINGON:COMMAND-ARGUMENTS.

Here's an example where it is used in clingon-demo echo foo bar baz ...

https://github.com/dnaeon/clingon/blob/master/examples/demo/echo.lisp