Correct optional command pattern matching