I've found Plac[1] to be a suitably terse and DRY method of building command-line interfaces. Basically, you write a Python function where each argument to the function becomes either an option, flag, or positional argument on the command line. It's one "line" to define the function's arguments (which might be split on multiple lines due to length, but it's just the function's argument list), plus one "line" to annotate each argument with a type, single-letter abbreviation, docstring, etc. (which might be longer than one line if the docstring is extra long). The "type" of an argument is any function that takes a string and returns anything, so you can for example have a function that parses and returns a comma-separated list of numbers as a Python list of floats. I think Plac supports subcommands, but I haven't used it that way.
If you want to see some examples of real-world usage of Plac, here are some examples from my own projects:
If you want to see some examples of real-world usage of Plac, here are some examples from my own projects:
https://github.com/DarwinAwardWinner/intemp/blob/master/inte...
https://github.com/DarwinAwardWinner/mergesam/blob/master/me...
https://github.com/DarwinAwardWinner/splitloci/blob/master/s...
https://github.com/DarwinAwardWinner/fastqident/blob/master/...
[1] http://plac.googlecode.com/hg/doc/plac.html