this would all benefit greatly from a bit of [cli](https://github.com/codegangsta/cli), IMHO