From 7dadfea71b290543fa374fbd1f5e83ec7101f4d8 Mon Sep 17 00:00:00 2001 From: Andreas Scherer Date: Wed, 2 Mar 2022 12:21:24 +0000 Subject: [WEB] Optional output file name. The original WEB programs had fixed arguments on the commandline, i.e., you had to invoke TANGLE with four file name arguments and WEAVE with three (where '/dev/null' was permitted as an empty file). This change makes the WEB programs a little bit like the CWEB programs by allowing an optional third file name argument for the main output file (the name of the .pool file still is created from the .web file). And '-' is interpreted as an empty change file. git-svn-id: svn://tug.org/texlive/trunk@62337 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/tangleboot.pin | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Build/source/texk/web2c/tangleboot.pin') diff --git a/Build/source/texk/web2c/tangleboot.pin b/Build/source/texk/web2c/tangleboot.pin index 29746a7a266..31eb05b511c 100644 --- a/Build/source/texk/web2c/tangleboot.pin +++ b/Build/source/texk/web2c/tangleboot.pin @@ -118,12 +118,14 @@ strictmode:=false; end else if(strcmp(longoptions[optionindex].name,'length')=0)then begin len:=atoi(optarg);if(len<=0)or(len>maxidlength)then len:=maxidlength; unambiglength:=len;end;until getoptreturnval=-1; -if(optind+1<>argc)and(optind+2<>argc)then begin writeln(stderr,'tangle', -': Need one or two file arguments.');usage('tangle');end; +if(optind+1>argc)or(optind+30 then chgname:=extendfilename(cmdline(optind+1),'ch');end; +if optind+3=argc then pascalname:=extendfilename(cmdline(optind+2), +chartostring('p'))else pascalname:=basenamechangesuffix(webname,'.web', +'.p');end;{:188}procedure initialize;var{16:}i:0..255;{:16}{41:}wi:0..2; {:41}{45:}zi:0..4;{:45}{51:}h:0..hashsize; {:51}begin kpsesetprogramname(argv[0],'tangle');parsearguments; {10:}history:=0;{:10}{14:}xchr[32]:=' ';xchr[33]:='!';xchr[34]:='"'; -- cgit v1.2.3