Parse end of command (end of input, new line or semicolon)