1. 首页
  2. 考试认证
  3. 其它
  4. args Java中命令行参数解析的可重用解决方案

args Java中命令行参数解析的可重用解决方案

上传者: 2024-10-15 19:10:16上传 ZIP文件 7.9KB 热度 9次

参数Java中命令行参数解析的可重用解决方案用法

// Initiate the arguments engine.

ArgsEngine engine = new ArgsEngine ();

// Configure the switches/options. Use true for valued options.

engine.add( \"-q\", \"--quiet\");

engine.add( \"-o\", \"--redirect-output\", true);

engine.add( \"-h\", \"--help\");

// Perform the parsing. The 'args' is the String[] received by main method.

engine.parse(args);

下载地址
用户评论