exit with an error code in cli mode and re-format error message
Merge pull request #68 from cakyus/master

exit with an error code in cli mode and re-format error message