In the mean time, here is a code snippet assuming that you command is already in buffer :
if (strcmp(buffer, "command1") == 0) {
executeCommand1();
}
else if (strcmp(buffer, "command2") == 0) {
executeCommand2();
}
else {
client.println("Invalid Command !");
}