[PATCH 5 of 8] revsetbenchmark: add a usage message when no arguments are passed

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Thu May 1 20:45:26 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1398458131 25200
#      Fri Apr 25 13:35:31 2014 -0700
# Node ID 3bb87edcae46d4362641d7a57c48a73e3ee076d4
# Parent  1be2c08892d5b7bdfe741556b2586a8d33d8b16d
revsetbenchmark: add a usage message when no arguments are passed

This increase the odd someone who didn't wrote will it find out how to use this
script.

diff --git a/contrib/revsetbenchmarks.py b/contrib/revsetbenchmarks.py
--- a/contrib/revsetbenchmarks.py
+++ b/contrib/revsetbenchmarks.py
@@ -64,10 +64,14 @@ def getrevs(spec):
         sys.exit(exc.returncode)
     return [r for r in out.split() if r]
 
 
 
+if len(sys.argv) < 2:
+    print >> sys.stderr, 'usage: %s <revs> [file]' % sys.argv[0]
+    sys.exit(255)
+
 target_rev = sys.argv[1]
 
 revsetsfile = sys.stdin
 if len(sys.argv) > 2:
     revsetsfile = open(sys.argv[2])


More information about the Mercurial-devel mailing list