sitron / lst

3 stars 3 forks source link

Simplifie/rewrite the command definition #17

Closed jeanmonod closed 10 years ago

jeanmonod commented 11 years ago

Creating a new command, and parsing args is not easy. Could we imagine rewrite this using a new base? Usage of one of those libs:

Any interest in this?

jeanmonod commented 11 years ago

For the output there is also: https://pypi.python.org/pypi/termcolor or https://pypi.python.org/pypi/colorama and https://github.com/erikrose/blessings

sitron commented 11 years ago

i'm definitely interested! a first step could be to just use sub args for all commands (and do parsing directly in the commands). i'll look into it asap

jeanmonod commented 11 years ago

I found the very nice https://github.com/docopt/docopt, could be great to use it for the command definition!

sitron commented 11 years ago

i just merged to dev the work done on argparse. Each command is now responsible of returning a list of arguments (positional or optional) it's waiting for. The added benefit is that you can now do lst [command] -h and see the list of args only for this command.