[pypy-svn] r19304 - pypy/dist/pypy/bin
arigo at codespeak.net
arigo at codespeak.net
Mon Oct 31 21:41:29 CET 2005
Author: arigo
Date: Mon Oct 31 21:41:28 2005
New Revision: 19304
Modified:
pypy/dist/pypy/bin/dotviewer.py
Log:
Better error message when running 'dotviewer.py' with no argument.
Modified: pypy/dist/pypy/bin/dotviewer.py
==============================================================================
--- pypy/dist/pypy/bin/dotviewer.py (original)
+++ pypy/dist/pypy/bin/dotviewer.py Mon Oct 31 21:41:28 2005
@@ -17,7 +17,7 @@
In the first form, show the graph contained in a .dot file.
In the other forms, connect to a graph server like
-goal/translate_pypy
+goal/translate_pypy.
''' % (sys.argv[0], sys.argv[0], sys.argv[0])
parser = optparse.OptionParser(usage=usage)
@@ -28,7 +28,10 @@
if __name__ == '__main__':
options, args = parser.parse_args()
if len(args) != 1:
- parser.error("too many options")
+ if args:
+ parser.error("too many arguments")
+ else:
+ parser.print_help()
sys.exit(2)
filename = args[0]
if py.path.local(filename).check():
More information about the Pypy-commit
mailing list