> Am 05.01.2018 um 15:30 schrieb Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>: > > On Thu, 04 Jan 2018, Knut Omang <knut.omang@xxxxxxxxxx> wrote: >> On Thu, 2018-01-04 at 17:50 +0200, Jani Nikula wrote: [...] >> Hmm - I have been burnt by the use of unstable interfaces in Python before, >> when I needed it to work on a (Linux) system with Python v.2.6.x only >> - argparse was introduced in v.2.7. and alternative choices are not >> at all clear to me, see for instance: >> >> https://dmerej.info/blog/post/docopt-v-argparse/ >> >> If this program was part of a "standalone" python project with a well defined python >> environment, I would probably have used argparse, which I have used in other projects. >> >> In fact I hesitated even to use python for this, because of fear of versioning issues.. >> When I was tempted anyway, and after looking at the existing examples in scripts/ >> ruling out python v.3.x, it felt safer to stay with the bare minimum of module >> features for this simple logic. >> >> I do feel confident that the benefits of python for this outweighs the drawbacks >> compared to my initial shell script implementation, or using perl or even C. >> >> Further advice on this appreciated, > > Again, I can only offer my opinion of requiring Python v2.7 and using > argparse, but it doesn't carry much weight. Up to the kbuild > maintainers. FYI: Py2.6 support has ended and Py2 expected to be end in 2020, the countdown is running ;) https://pythonclock.org/ If you wan't a command-line parser which is "builtin" use argparse, this is what I do mostly. If you are able to use requirements from outside use click [1]. For more infos read e.g. [2]. Docopt [3] has its charm but I would prefer the decorators from click. [1] http://click.pocoo.org/5/ [2] https://realpython.com/blog/python/comparing-python-command-line-parsing-libraries-argparse-docopt-click/ [3] https://github.com/docopt -- Markus ---- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html