Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to skip to next option if parse error
Allows providing a function to handle the case of an unknown option. ``` public static void main(String[] args) { try { try (ConfigurationParser parser = new ConfigurationParser(new String[]{"-keep class * {}", "-unknownoption", "-whatisthisoption?"}, System.getProperties())) { parser.parse(new Configuration(), (option, location) -> { System.out.println("Unknown option: " + option + " @ " + location); }); } catch (ParseException ex) { ex.printStackTrace(); } } catch (IOException ex) { ex.printStackTrace(); } } ``` Output: ``` Unknown option: -unknownoption @ argument number 2 Unknown option: -whatisthisoption? @ argument number 3 ```
- Loading branch information