编写命令行工具
1、使用 common-cli 编写命令行工具 commons-cli 是Apache开源组织提供的用于解析命令行参数的包。 先引用common-cli依赖包: <groupId>commons-cli</groupId><artifactId>commons-cli</artifactId><version>1.2</version> 命令定义: private static final Options OPTIONS = new Options(); public void defineCommand() { OPTIONS.addOption("i", true, "the input directory where the proto files are"); OPTIONS.addOption("o", true, "the output directory which is the output path"); OPTIONS.addOption("c",true,"whether we use config.json or not"); OPTIONS.addOption("groupId",true,"maven project related parameter"); OPTIONS.addOption("artifactId",true,"maven