clingon icon indicating copy to clipboard operation
clingon copied to clipboard

Support named positional arguments

Open nacl opened this issue 2 years ago • 2 comments

Hello!

Clingon looks rather nice. Looking through it, I wonder if there's support for what python's argparse calls "positional arguments". That is, arguments on the command line that are not associated with options, but are still accessible by a given name after arguments are processed.

For example, say I wanted to be able to access the first two named arguments as "foo" and "bar". If the user passes in:

$ cmd first second

A function like:

(getopt cmd 'bar)

should return "second".

Does clingon support this? I didn't see anything when I browsed the documentation and examples.

While it is possible to process the free arguments list to extract these arguments, it would be much simpler for the user if clingon could deal with it implicitly and provide all the nice machinery it provides for free.

nacl avatar Nov 24 '23 13:11 nacl

Hey @nacl ,

Currently this behaviour is not supported in clingon. If I find some spare time I might be able to look into implementing it, but I'd also be happy to review any PRs!

Thanks!

dnaeon avatar Nov 24 '23 14:11 dnaeon