Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Googling the library appears to be about ~8,000 lines of code (core.py is ~2,000 alone).

Is that really reasonable sounding to most people for parsing CLI input/output and display manpages or helptext?



I suppose it depends on the use case. Personally I've always thought argparse is good enough, and have never hit a roadblock "because I'm using argparse" so to say. Having said that, I do like the pattern click is going for. If it argparse allowed the same pattern, in my opinion that would be cool, and it would probably be my first choice.


argparse should not be the first thing to reach for, imo, when good old sys.argv can do the job.


At that point I wouldn't leave bash. I feel like argparse allows for better documentation, error handling and input validation.


I didn’t mean to suggest we should reach for Click for simple help/manpage display.

The case I used it for was much more complex. What I liked about it was the easy to use API, clear documentation & examples, and readable patterns.

For simple text display, I like the solution from the article, and I learned something new about bash scripts. Also, I learned from comments you can use heredoc in bash!


I'm not trying to be antagonistic here... but who cares how many lines it has unless you plan to maintain it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: