Skip to content

Commit

Permalink
Rename options["files"] to options["names"]
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
josephwright committed Mar 6, 2018
1 parent ccbd88e commit 1bf0dc0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions l3build-arguments.lua
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions l3build-stdmain.lua
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion l3build.dtx
Expand Up @@ -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 \\
Expand Down
4 changes: 2 additions & 2 deletions l3build.lua
Expand Up @@ -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
Expand Down Expand Up @@ -103,4 +103,4 @@ if #checkconfigs == 1 and
end
-- Call the main function
main(options["target"], options["files"])
main(options["target"], options["names"])

0 comments on commit 1bf0dc0

Please sign in to comment.