Apache Commons CLI 1.3.1: How to ignore unknown Arguments?
I used to work with Apache Commons Cli 1.2. I wanted the parser to ignore arguments if they are unknown (not added to an Options-Object). Example (pseudocode): Options specialOptions; specialOptions.addOption(null, "help", false, "shows help"); specialOptions.addOption(null, "version", false, "show version"); CommandLineParser parser = new DefaultParser(); CommandLine cmd = parser.parse(options, args); //no third argument, since i dont want the program to stop parsing. // run program with args: --help --unknown --version // program shall parse --help AND --version, but ignore --unknown I used
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.