add command decide logic
Merge pull request #8 from fotaki/master

add command decide logic