On Fri 22 Nov 2013 at 07:22:20PM -0500, John Szakmeister wrote:

> This looks very nice.  Have you considered something along the lines
> of Python's argparse?
>
>     http://docs.python.org/dev/library/argparse.html

Thank you. I am not familiar with Python's argparse. My experience with
option parsers are primarily the C functions getopt and getopt_long, the
getopts builtin in bash, and Ruby's OptionParser.

On first scan, argparse and OptionParser appear to be very similar,
both in capability and programming interface. I know OptionParser
particularly well, and while I enjoy its flexibility and power, the
actual implemention and scope of what it tries to accomplish are quite
un-Clojuresque.

The beautiful thing about tools.cli is that it is conceptually very
simple: it reduces an option specification and a list of arguments into
a map of configuration options.

IMHO, printing elaborate usage banners, associating subcommands with
methods, managing options of subcommands, and invoking behaviour should
be handled separately from option parsing. The guiding principle of
optparse-clj and the next version of tools.cli is to provide data and
let the user take it from there.

> It's nice to see you thought about subcommand support as well. Thank
> you for your contribution!

The gist I linked to earlier¹ contains a detailed proposal for how I'd
like to advance tools.cli. If you are interested, comments on that are
much appreciated.

Cheers,

    guns

¹ https://gist.github.com/guns/7573819/raw

Attachment: pgpLaYZua_fTs.pgp
Description: PGP signature

Reply via email to