mirror of
https://github.com/Guardsquare/proguard.git
synced 2026-03-13 09:50:34 +08:00
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
```