Item item = registry.getItemByPattern(itemName);
if(args.length>1) {
String commandName = args[1];
Command command = TypeParser.parseCommand(item.getAcceptedCommandTypes(), commandName);
if(command!=null) {
publisher.sendCommand(itemName, command);
console.println("Command has been sent successfully.");
} else {
console.println("Error: Command '" + commandName +
"' is not valid for item '" + itemName + "'");
console.print("Valid command types are: ( ");