Parser for command line parameters in Java / C / C + + / Python / shell

I'm looking for a library to parse command line parameters that are the same in Java, C / C + +, Python and (best) shell "Same" I mean (1) having exactly the same rules to resolve parameters in all three languages, (2) using the same configuration file or having a similar API to specify parameters, and (3) having a similar API to access parameter values

I always use getopt in C and Apache cli in Java, but it's good to use the same specification for parameters across multiple languages

Solution

Getopt can also be used in Python and shell Python has the argparse module, which is easier to use (especially for more complex parameter parsing), but if you want consistency in all these languages, I don't know a better choice than getopt If there is no getopt implementation in Java, you can write one yourself without much effort

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>