Here's how the hk app does it: https://github.com/heroku/hk/blob/master/main.go#L120
Basically it reads the arguments to the executable and matches them against a built-in list of supported commands and dispatches appropriately.
node.js - http://nodejs.org/docs/latest/api/process.html#process_proce...
python - http://docs.python.org/2/library/sys.html
ruby - http://www.ruby-doc.org/core-2.0.0/ARGF.html#method-i-argv
Here's how the hk app does it: https://github.com/heroku/hk/blob/master/main.go#L120
Basically it reads the arguments to the executable and matches them against a built-in list of supported commands and dispatches appropriately.