chiark / gitweb /
make-secnet-sites: Fix argument parsing with options
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 7 Nov 2019 00:01:44 +0000 (00:01 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 7 Nov 2019 00:05:40 +0000 (00:05 +0000)
In "make-secnet-sites: Use argparse rather than ad-hoc parser",
we missed a reference to sys.argv.  The effect is that if
make-secnet-sites run in sites file output mode, and provided
with options, the output is written to the wrong place.

The only syntax that worked in 0.4.5 and broke in 0.5.0 is
make-secnet-sites -P.  So here we fix that regression.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
make-secnet-sites

index 668dbf635b02ec9e98533e5e8b261297614074fb..3fc6fcdbe55a069344ed6c8dfe057cbc1bdbfe19 100755 (executable)
@@ -250,7 +250,7 @@ def parse_args():
                        sys.exit(1)
                (inputfile, outputfile) = (av.arg + [None]*2)[0:2]
                if outputfile is None: of=sys.stdout
-               else: of=open(sys.argv[2],'w')
+               else: of=open(outputfile,'w')
 
 parse_args()