Am I correct that if you execute the following executable script
#! /usr/local/bin/python
import sys
print sys.argv
with a command line argument of -a, say, you get a usage message from
Python? You should get this output (assuming the script was called
t.py):
['./t.py', '-a']
If you don't, you have probably linked with the GNU getopt, which
scans the entire command line for options rather than stopping at the
first non-option. There's a getopt in the distribution
(Python/getopt.c) which you may add to the Makefile. You can also
change the first line of the script into
#! /usr/local/bin/python --
which should tell getopt to stop parsing.
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
<URL:http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>