hylang/hy — pull request #231 by rwtolbert (2013-07-07 00:38:05+00:00)
Title: Fix commandline scripts and support Windows 

This PR fixes the command line argument handling in "hy". The current version eats all CL arguments,
making it impossible to pass args to a user script. The change it to make "hy" work just like Python. Arguments before a user script are consumed by "hy". The user script is passed a modified version of sys.argv where the user script is in sys.argv[0] and any args for the script are in sys.argv[1:] just like Python. I also stash the location of the "hy" script in hy.executable just like sys.executable points to the actual Python executable.

This also does away with the scripts in "bin" and changes
setup.py to use entry_points in cmdline.py for the scripts 'hy' and
'hyc'. This allows setup.py to install hy and hyc for *nix and hy.exe/hyc.exe for Windows.

This fixes installing and running on Windows.

The tests are updated to run the 'hy' script produced by setup.py
and not from bin/hy. This is more correct and makes the tox tests
run on both Window and *nix.

There is also now a make.bat file that mirrors the Makefile. Note that pypy is omitted from "make.bat tox" on Windows since there appears to be an outstanding bug with creating a pypy virtualenv on Windows.

For running hy or nosetests directly in the source tree, you do have
to run 'python setup.py develop' first. But since tox runs and builds
dists, all tox tests pass on all platforms.