Serial Input - Parsing multiple formats

Perhaps this link CMD library will help you

Or this CmdMessenger Library
look at ConsoleShell.ino thats a good example to starting.