Added function to validate a command's text.