Ever played with ArduinoSerialCommand? Nice library, but it lacks the possibility to retrieve current command. This possibility is waiting in the pull request for a long time, so if you deadly need it – merge it by yourself.