[pro] what lisp command line arg parser is good?
Anyone with some thoughts on which command line parser is good to use? There seem to be n of them out there. None really stands out, that I can tell. Must be quicklisp readable, other than that, I don't have any kind of fancy requirements. Just something simple, and reliable. Widely used would be good, and/or well maintained. Any pro tips? Thanks, Mark
* Mark H. David <zuq@li.bet> [2011-12-20 11:23:17 -0500]:
Anyone with some thoughts on which command line parser is good to use? There seem to be n of them out there. None really stands out, that I can tell.
in such situation the usual answer is to use whatever is easier to install. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000 http://dhimmi.com http://jihadwatch.org http://pmw.org.il http://mideasttruth.com http://openvotingconsortium.org http://www.memritv.org Conscience is like a hamster: it is either asleep or gnawing.
Well, in the era of Quicklisp, they're all pretty much equally easy. Next? On 12/20/2011 11:48 AM, Sam Steingold wrote:
* Mark H. David<zuq@li.bet> [2011-12-20 11:23:17 -0500]:
Anyone with some thoughts on which command line parser is good to use? There seem to be n of them out there. None really stands out, that I can tell. in such situation the usual answer is to use whatever is easier to install.
"Mark H. David" <mhd-snjaRoHNxXM@public.gmane.org> writes:
Well, in the era of Quicklisp, they're all pretty much equally easy. Next?
On 12/20/2011 11:48 AM, Sam Steingold wrote:
* Mark H. David<zuq-OTbhCmRf1Ns@public.gmane.org> [2011-12-20 11:23:17 -0500]:
Anyone with some thoughts on which command line parser is good to use? There seem to be n of them out there. None really stands out, that I can tell. in such situation the usual answer is to use whatever is easier to install.
Well, the one I use is not in quicklisp, because my scripts don't use quicklisp. It's in: http://git.informatimago.com/viewgit/index.php?a=viewblob&p=public/bin&h=6a37dd5966274aa5717063baef49b5c24c3fddc1&hb=0ca91647899d87e624869460857b0afe70a26f90&f=script.lisp examples of usage can be found in the various scripts written in clisp in that repository, such as: http://git.informatimago.com/viewgit/index.php?a=viewblob&p=public/bin&h=1a180a741ab8c57069d66f557104d8323651520d&hb=0ca91647899d87e624869460857b0afe70a26f90&f=radio script.lisp is merely loaded with: (load (make-pathname :name "SCRIPT" :type "LISP" :version NIL :case :common :defaults *load-pathname*)) in the various scripts. But I guess it could be made into an asdf system loadable by quicklisp for people who like their scripts to start by loading tons of dependencies, or for people writing program. Otherwise, have you had a look at Didier Verna's CLON? -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}.
"Mark H. David" <mhd@yv.org> wrote:
Anyone with some thoughts on which command line parser is good to use?
Yes.
There seem to be n of them out there.
Is n that big ?
None really stands out, that I can tell.
Damn. I need a Ph.D. in communication I guess :-) Try out mine: http://www.lrde.epita.fr/~didier/software/lisp/clon.php
Must be quicklisp readable
Yes.
Just something simple
It's not really "simple", but look at the quickstart from the user manual. This will get you started quickly.
Widely used would be good
Probably not.
well maintained.
Yes. Probably the most important caveat, currently, is that it's not tested (and probably won't work) in ACL or LispWork because it requires features that are not available in the free editions. I hope to fix that soon however. -- Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com
Yes, I think "n" is pretty big. I seem to find new ones all the time. There's no single list of them. You just have to keep trying search with variants like "command-line" "command line" "getopt" etc.! (OT: there really are "n", and it's not that small now, Lisp library guides. Can someone do one that organizes them by category, e.g., command line parser, and then gives all the info on one page about them, like a Wikipedia style table of all the info? I don't find it that fun/productive to search variants of my keyword, then depth-first-searching all of them, which involves: click one, check its summary doc (if any), then click the home page, then click around there for doc, etc.... Just in you all's spare time, eh? :) Or, perhaps Manifest can do this automagically some day: that would totally rock!) Didier, your library looks by far the most complete, but therefore it's a bit daunting. But many + points for speaking up and showing some interest. Plus I saw Don't need LW nor ACL. Your package is now the leading candidate! -Mark On 12/20/2011 12:08 PM, Didier Verna wrote:
"Mark H. David"<mhd@yv.org> wrote:
Anyone with some thoughts on which command line parser is good to use? Yes.
There seem to be n of them out there. Is n that big ?
None really stands out, that I can tell. Damn. I need a Ph.D. in communication I guess :-) Try out mine:
http://www.lrde.epita.fr/~didier/software/lisp/clon.php
Must be quicklisp readable Yes.
Just something simple It's not really "simple", but look at the quickstart from the user manual. This will get you started quickly.
Widely used would be good Probably not.
well maintained. Yes.
Probably the most important caveat, currently, is that it's not tested (and probably won't work) in ACL or LispWork because it requires features that are not available in the free editions. I hope to fix that soon however.
Hi Mark and the others, On 20 dec. 2011, at 18:25, "Mark H. David" <mhd@yv.org> wrote:
Didier, your library looks by far the most complete, but therefore it's a bit daunting.
I have used CLON here: - http://github.com/aerique/google-ai-challenge-2011-1-ants/blob/master/src-pl... - http://github.com/aerique/google-ai-challenge-2011-1-ants/blob/master/src-pr... and have been pretty happy with it. It is also thoroughly documented and comes with examples. Didier was pretty responsive to any questions I had.
"Mark H. David" <mhd@yv.org> wrote:
Didier, your library looks by far the most complete, but therefore it's a bit daunting.
Feedback welcome. I have some ideas on how to make it even simpler to use for simple apps. One suggestion from pcos was to define a "main" function, the arglist of which would represent options to define and retrieve automatically. It's on my TODO list. -- Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com
On Tue, Dec 20, 2011 at 11:23, Mark H. David <mhd@yv.org> wrote:
Anyone with some thoughts on which command line parser is good to use? There seem to be n of them out there. None really stands out, that I can tell. Must be quicklisp readable, other than that, I don't have any kind of fancy requirements. Just something simple, and reliable. Widely used would be good, and/or well maintained. Any pro tips?
I wrote and use command-line-arguments, which is not the greatest imaginable, but is 100% portable and works well. git clone git://common-lisp.net/projects/qitab/command-line-arguments.git Didier Verna's CLON has all the bells and whistles you could dream of and then some, but has stricter system dependency requirements and seems harder to package out. http://www.lrde.epita.fr/~didier/software/lisp/clon.php Finally, if you're ready to accept SBCL only, Xach has something as part of buildapp. http://www.xach.com/lisp/buildapp/ Tell us what you use in the end, and why, and whether there are more such libraries to consider. —♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org Meta is Better. Anything you can do, I can do Meta. — Patrick Logan
Faré <fahree@gmail.com> writes:
Finally, if you're ready to accept SBCL only, Xach has something as part of buildapp. http://www.xach.com/lisp/buildapp/
Buildapp doesn't really do anything reusable for command-line arguments. Robert Brown's "lisp-gflags" seems interesting. Zach
Hi Mark, On 21/12/2011, at 2:23 AM, Mark H. David wrote:
Anyone with some thoughts on which command line parser is good to use? There seem to be n of them out there. None really stands out, that I can tell. Must be quicklisp readable,
I have one called lisp-executable. It is available here: https://github.com/markcox80/lisp-executable It is not quick lisp installable, but all of its dependencies are quicklisp installable. The library provides the ability to automatically generate programs by working with ASDF. Documentation can be found in the Org file contained within the project. An example of creating a command line program is: ;; defined in system lisp-executable-example (define-program example-program (&options help) (cond (help (format t "Help has arrived.")) (t (format t "You are doomed."))) (terpri)) (create-executable 'example-program "/tmp/my-program" :asdf-system "lisp-executable-example") Mark
participants (8)
-
Didier Verna
-
Erik Winkels
-
Faré
-
Mark Cox
-
Mark H. David
-
Pascal J. Bourguignon
-
Sam Steingold
-
Zach Beane