code: private static int findCommandIndex(String[] args) {
  	int commandIndex = -1;
  
  	for (int i = 0; i < args.length; i++) {
  	    for (Command command : Command.values()) {
  		if (command.getName().equals(args[i].trim())) {
  		    commandIndex = i;
  		    
  		    break;
  		}
  	    }
  	}
  
  	return commandIndex;
      }
docs: Looks for the index of command in the specified array.
  
  @param args
  - Arguments.
  @return - Index of command, or -1 if command is not found in the array.