import org.apache.commons.cli.*; public class CommandLineParserExample { public static void main(String[] args) { CommandLineParser parser = new DefaultParser(); Options options = new Options(); try { CommandLine commandLine = parser.parse(options, args); String inputFilePath = commandLine.getOptionValue("i"); String outputFilePath = commandLine.getOptionValue("o"); if (inputFilePath != null && outputFilePath != null) { } else { } } catch (ParseException e) { } } }


上一篇:
下一篇:
切换中文