protected void doHandle(CommandContext ctx) throws CommandFormatException {
final ParsedCommandLine parsedCmd = ctx.getParsedCommandLine();
String nodePath = this.nodePath.getValue(parsedCmd);
final OperationRequestAddress address;
if (nodePath != null) {
address = new DefaultOperationRequestAddress(ctx.getPrefix());
CommandLineParser.CallbackHandler handler = new DefaultCallbackHandler(address);
nodePath = ctx.getArgumentsString();
if(l.isPresent(parsedCmd)) {
nodePath = nodePath.trim();
if(nodePath.startsWith("-l ")) {
nodePath = nodePath.substring(3);
} else {
nodePath = nodePath.substring(0, nodePath.length() - 3);
}
}
try {
ctx.getCommandLineParser().parse(nodePath, handler);
} catch (CommandFormatException e) {
ctx.printLine(e.getLocalizedMessage());
}
} else {
address = new DefaultOperationRequestAddress(ctx.getPrefix());
}
final List<String> names;
if(address.endsOnType()) {
final String type = address.getNodeType();
address.toParentNode();
names = Util.getNodeNames(ctx.getModelControllerClient(), address, type);
} else {
names = Util.getNodeTypes(ctx.getModelControllerClient(), address);
}