compare the cmd type