From: Eric S. Raymond Date: Sat, 29 Nov 2014 10:51:12 +0000 (-0500) Subject: A check for options in the wrong place. Regression testt passes. X-Git-Tag: 0.14~1 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=1469c1ecd6be38e2b75aecf675eca8093c315035;p=src.git A check for options in the wrong place. Regression testt passes. --- diff --git a/src b/src index f87b2a6..3b3807d 100755 --- a/src +++ b/src @@ -1932,6 +1932,8 @@ if __name__ == "__main__": repodir = commandline[1] explicit = True commandline.pop(0) + else: + croak("unknown option %s before command verb" % commandline[0]) commandline.pop(0) # RCS backwards-compatibility hack @@ -1947,7 +1949,7 @@ if __name__ == "__main__": if commandline[0] in dispatch: dispatch[commandline[0]](*commandline[1:]) else: - sys.stderr.write("src: no such command as '%s'. Try 'src help'\n" \ + croak("no such command as '%s'. Try 'src help'" \ % commandline[0]) except KeyboardInterrupt: pass