5 ms·
Does this do anything that the builtin argparse library https://docs.python.org/3/library/argparse.html https://docs.python.org/3/library/argparse.html doesn't?
by btown 7y ago
Does this do anything that the builtin argparse library https://docs.python.org/3/library/argparse.html https://docs.python.org/3/library/argparse.html doesn't? Seems it just turns it into decorator syntax.
- jle17 7y agoIt really comes handy IMHO when you have a lot of commands with nesting and context to share. I've used it on a CLI tool with many sub-commands implemented in imported modules and it made things really easy while I don't think argpase would have "scaled" without becoming a mess. Plus it comes with some useful utilities you might need in a cli to show a progressbar, display color, open test in a pager/an editor etc. The official doc is really nice and gives it more justice than this blog post: https://click.palletsprojects.com/en/7.x https://click.palletsprojects.com/en/7.x.
- btown 7y agoAh - makes a lot more sense when they describe Git, with its nested interfaces and argument parsers (and reused logic therein) as a motivating example!