JuliaLang/julia — pull request #3881 by amitmurthy (2013-07-30 11:18:33+00:00)
Title: Command line argument support for package args and env vars

This PR supports the following additional command line arguments:

- ```--package- var val``` which allows for package specific command line arguments. Currently stored as ```.var``` fields in a global dict - PACKAGE_ARGS (to be exported)

- ```--package pkgname``` loads said package after all other common line arguments have been processed

- ```env var val``` adds said ```var``` into ENV

The requirement for the above came about by a need to bundle server type components as packages and have an ability to easily configure and start them up on remote machines using ssh commands. Since a ```.jl``` file is run on package loading, the behavior of the said code can be controlled by package specific arguments.

If this PR is acceptable, I will also do the following

1. Send package specific args and env variables to all workers.
2. Add another option ```--detach``` which will result in the REPL not being launched and the julia process will run as long as any tasks are scheduled either due to package loading at startup or due to a ```-e``` option. Again useful in launching servers directly from packages without having a startup script or a lengthy ```-e``` option via ssh commands. Functionally similar to the --worker flag, except that it does not start listening on a random port but runs till any scheduled tasks complete

Will need help/suggestions in implementing a ```--detach``` option.