Check if output type is supported by command

This commit is contained in:
AsamK 2021-01-16 21:12:01 +01:00
parent c588130491
commit a2debdb234
6 changed files with 37 additions and 0 deletions

View file

@ -91,6 +91,12 @@ public class Cli {
return 1;
}
OutputType outputType = ns.get("output");
if (!command.getSupportedOutputTypes().contains(outputType)) {
logger.error("Command doesn't support output type {}", outputType.toString());
return 1;
}
String username = ns.getString("username");
final boolean useDbus = ns.getBoolean("dbus");