From 1bf0dc06e6db49c9018e36788543b39d534ea08e Mon Sep 17 00:00:00 2001 From: Joseph Wright Date: Tue, 6 Mar 2018 08:50:38 +0000 Subject: [PATCH] Rename options["files"] to options["names"] This is a 'breaking' change (though likely no impact). Reasoning: we want the list of 'files' for a few things, including upcoming tagging. It's not really a list of files: they could be various things. --- l3build-arguments.lua | 16 ++++++++-------- l3build-stdmain.lua | 4 ++-- l3build.dtx | 2 +- l3build.lua | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/l3build-arguments.lua b/l3build-arguments.lua index b1d5b44a..78eb5424 100644 --- a/l3build-arguments.lua +++ b/l3build-arguments.lua @@ -122,7 +122,7 @@ option_list = -- termination (break) local function argparse() local result = { } - local files = { } + local names = { } local long_options = { } local short_options = { } -- Turn long/short options into two lookup tables @@ -150,11 +150,11 @@ local function argparse() end -- An auxiliary to grab all file names into a table local function remainder(num) - local files = { } + local names = { } for i = num, #arg do - table.insert(files, arg[i]) + table.insert(names, arg[i]) end - return files + return names end -- Examine all other arguments -- Use a while loop rather than for as this makes it easier @@ -164,7 +164,7 @@ local function argparse() local a = arg[i] -- Terminate search for options if a == "--" then - files = remainder(i + 1) + names = remainder(i + 1) break end -- Look for optionals @@ -232,12 +232,12 @@ local function argparse() i = i + 1 end if not opt then - files = remainder(i) + names = remainder(i) break end end - if next(files) then - result["files"] = files + if next(names) then + result["names"] = names end return result end diff --git a/l3build-stdmain.lua b/l3build-stdmain.lua index 200afa99..d6d59f1a 100644 --- a/l3build-stdmain.lua +++ b/l3build-stdmain.lua @@ -46,7 +46,7 @@ end -- The overall main function -- -function stdmain(target, files) +function stdmain(target, names) local errorlevel -- If the module name is empty, the script is running in a bundle: -- apart from ctan all of the targets are then just mappings @@ -90,7 +90,7 @@ function stdmain(target, files) elseif target == "bundlectan" then errorlevel = bundlectan() elseif target == "doc" then - errorlevel = doc(files) + errorlevel = doc(names) elseif target == "check" then errorlevel = check(files) elseif target == "clean" then diff --git a/l3build.dtx b/l3build.dtx index ae5b926e..71896a70 100644 --- a/l3build.dtx +++ b/l3build.dtx @@ -1252,10 +1252,10 @@ % \midrule % \var{date} & String \\ % \var{engine} & Table \\ -% \var{files} & Table \\ % \var{force} & Boolean \\ % \var{halt} & Boolean \\ % \var{help} & Boolean \\ +% \var{names} & Table \\ % \var{pdf} & Boolean \\ % \var{quiet} & Boolean \\ % \var{rerun} & Boolean \\ diff --git a/l3build.lua b/l3build.lua index 0c3433c9..6d189185 100644 --- a/l3build.lua +++ b/l3build.lua @@ -71,7 +71,7 @@ main = main or stdmain -- When we have specific files to deal with, only use explicit configs -- (or just the std one) -if options["files"] then +if options["names"] then checkconfigs = options["config"] or {stdconfig} else checkconfigs = options["config"] or checkconfigs @@ -103,4 +103,4 @@ if #checkconfigs == 1 and end -- Call the main function -main(options["target"], options["files"]) +main(options["target"], options["names"])