Discussion:
what lisp command line arg parser is good?
Mark H. David
2011-12-20 16:23:17 UTC
Permalink
Content preview: 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 [...]


Content analysis details: (0.0 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/589>

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
Sam Steingold
2011-12-20 16:48:34 UTC
Permalink
Post by Mark H. David
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. [...]

Content analysis details: (-100.0 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-100 USER_IN_WHITELIST From: address is in the user's white-list
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
(sam.steingold[at]gmail.com)
-0.0 SPF_PASS SPF: sender matches SPF record
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/590>
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.
Mark H. David
2011-12-20 16:53:24 UTC
Permalink
Content preview: 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-***@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. > [...]

Content analysis details: (0.0 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/591>

Well, in the era of Quicklisp, they're all pretty much equally easy. Next?
Post by Sam Steingold
Post by Mark H. David
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.
Pascal J. Bourguignon
2011-12-20 17:10:05 UTC
Permalink
Well, in the era of Quicklisp, they're all pretty much equally easy. Next?
[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. [...]

Content analysis details: (-2.6 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-0.0 SPF_HELO_PASS SPF: HELO matches SPF record
-0.0 SPF_PASS SPF: sender matches SPF record
-2.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/596>
Well, in the era of Quicklisp, they're all pretty much equally easy. Next?
Post by Sam Steingold
Post by Mark H. David
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 {}.
Faré
2011-12-20 17:15:26 UTC
Permalink
Post by Mark H. David
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
Zach Beane
2011-12-20 17:46:32 UTC
Permalink
Post by Faré
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
Didier Verna
2011-12-20 17:08:00 UTC
Permalink
Content preview: "Mark H. David" <mhd-***@public.gmane.org> wrote: > Anyone with some thoughts
on which command line parser is good to use? Yes. [...]

Content analysis details: (-102.6 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-100 USER_IN_WHITELIST From: address is in the user's white-list
-2.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/593>
Post by Mark H. David
Anyone with some thoughts on which command line parser is good to use?
Yes.
Post by Mark H. David
There seem to be n of them out there.
Is n that big ?
Post by Mark H. David
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
Post by Mark H. David
Must be quicklisp readable
Yes.
Post by Mark H. David
Just something simple
It's not really "simple", but look at the quickstart from the user
manual. This will get you started quickly.
Post by Mark H. David
Widely used would be good
Probably not.
Post by Mark H. David
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
Mark H. David
2011-12-20 17:25:00 UTC
Permalink
Content preview: 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.! [...]

Content analysis details: (0.0 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/594>

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
Post by Didier Verna
Post by Mark H. David
Anyone with some thoughts on which command line parser is good to use?
Yes.
Post by Mark H. David
There seem to be n of them out there.
Is n that big ?
Post by Mark H. David
None really stands out, that I can tell.
http://www.lrde.epita.fr/~didier/software/lisp/clon.php
Post by Mark H. David
Must be quicklisp readable
Yes.
Post by Mark H. David
Just something simple
It's not really "simple", but look at the quickstart from the user
manual. This will get you started quickly.
Post by Mark H. David
Widely used would be good
Probably not.
Post by Mark H. David
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.
Erik Winkels
2011-12-20 18:44:19 UTC
Permalink
Content preview: Hi Mark and the others, On 20 dec. 2011, at 18:25, "Mark H.
David" <mhd-***@public.gmane.org> wrote: > Didier, your library looks by far the most complete,
but therefore it's a bit daunting. I have used CLON here: [...]

Content analysis details: (-102.6 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-100 USER_IN_WHITELIST From: address is in the user's white-list
-2.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/597>

Hi Mark and the others,
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-play-game/play-game.lisp
- http://github.com/aerique/google-ai-challenge-2011-1-ants/blob/master/src-proxy-bot/proxy-bot.lisp

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.
Didier Verna
2011-12-21 09:55:01 UTC
Permalink
Content preview: "Mark H. David" <mhd-***@public.gmane.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. [...]

Content analysis details: (-99.6 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-100 USER_IN_WHITELIST From: address is in the user's white-list
0.4 RDNS_DYNAMIC Delivered to internal network by host with
dynamic-looking rDNS
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/599>
Post by Mark H. David
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
Mark Cox
2011-12-21 08:39:35 UTC
Permalink
Content preview: 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, [...]
Content analysis details: (0.1 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
(markcox80[at]gmail.com)
-0.0 SPF_PASS SPF: sender matches SPF record
0.1 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in
digit (markcox80[at]gmail.com)
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/598>

Hi Mark,
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
Loading...