5 ms·
I recently wrote this (https://github.com/jamesob/clii https://github.com/jamesob/clii) because I can't stand click and got sick of having to check the argparse
by jobeirne 6y ago
I recently wrote this (https://github.com/jamesob/clii https://github.com/jamesob/clii) because I can't stand click and got sick of having to check the argparse docs every time I wanted to write a CLI. I guarantee you'll spend a tenth of the time trying to figure out how to use this thing, it has no dependencies, and is implemented in a single vendor-friendly file.
- darkteflon 6y agoThis looks really good actually - bullshit-minimising. Will check it out.
- fastball 6y agoThere is also Typer[1] [1] https://github.com/tiangolo/typer https://github.com/tiangolo/typer
- tboerstad 6y agoYou really nailed this, imho. Awesome work. What is the reason for requiring Python >=3.7?
- jobeirne 6y agoThanks. That's a really good point - maybe it's usable on earlier versions. Can't remember why I thought otherwise, will have to test.
- sk0g 6y agoDoes it handle help automatically? If not, and you think that'd be a valuable addition, I would like to take a crack at implementing it :) What I mean is if you execute script.py help, it will print out the possible options, along with their docstrings, or maybe just the first line.
- jobeirne 6y agoIt does parse docstrings in a very basic way (https://github.com/jamesob/clii#help-text-from-docstrings https://github.com/jamesob/clii#help-text-from-docstrings) but if you end up hacking in something you want, PRs are welcome.