3 ms·
As soon as as the cli becomes non-trivial I switch to python and use docopt for that (really cool module btw.). Pipelining processes is not as idiomatic in Pyth
by xurukefi 6y ago
As soon as as the cli becomes non-trivial I switch to python and use docopt for that (really cool module btw.). Pipelining processes is not as idiomatic in Python as it is in Bash though, but everything is better than getopts. I'd rather decapitate myself with a teaspoon than using getopts.
- OJFord 6y agoDocopt exists (now, think it was originally python) for many languages including bash [0] (or perhaps it's POSIX, haven't checked). I like it too, not least because I can use ~the same thing in multiple languages and not have to remind myself how the arg parser for language X works each time. [0] - https://github.com/docopt/docopts https://github.com/docopt/docopts
- vlovich123 6y agoYeah, I’m kind of shocked to see so many masochists in this thread. Built-in subprocess is nice and all but I’ve had a lot of joy using https://amoffat.github.io/sh/ https://amoffat.github.io/sh/ to do the work (and the maintainer is super responsive). I sometimes don’t have the flexibility to have external dependencies but I’d use it everywhere if Python just folded it into the default library.