From: Ian Jackson Date: Thu, 7 Nov 2019 00:01:44 +0000 (+0000) Subject: make-secnet-sites: Fix argument parsing with options X-Git-Tag: v0.5.1~53 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=secnet.git;a=commitdiff_plain;h=f5c5fb86331aac7ec034dd5a7c4feaf8cec1bc56 make-secnet-sites: Fix argument parsing with options 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 --- diff --git a/make-secnet-sites b/make-secnet-sites index 668dbf6..3fc6fcd 100755 --- a/make-secnet-sites +++ b/make-secnet-sites @@ -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()