balderdashy/sails — pull request #399 by colinwren (2013-05-21 19:02:33+00:00)
Title: Split cli code into seperate files

I separated `bin/sails.js` into files based on the cli commands. The cleanest way to handle the cli is to have `bin/sails.js` process the arguments and then call a function exported by a command specific file. There was lots of commented out code and unused requires but I left that in because it looked like it was left there so it could be easily implemented in the future.

Certain commands like `upgrade` weren't separated out because they lacked test coverage and I wasn't clear on their exact functionality so I didn't want to risk breaking them by moving them.

@dcbartlett is going to separate out `upgrade` and i'll add test coverage for it and the rest of the commands.

The command files will be moved into `bin/lib`, I started doing so but I got lots of unexpected errors with `lift` and `generate`. I will look into this further and add more test coverage to ensure that nothing breaks when the command files are moved into `lib/bin`.