[latex3-commits] [git/LaTeX3-latex3-l3build] master: Some local copies (9e6440d)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Jul 29 11:13:30 CEST 2018


Repository : https://github.com/latex3/l3build
On branch  : master
Link       : https://github.com/latex3/l3build/commit/9e6440d891a6a4a492aabeb37f50b80ce51cd38d

>---------------------------------------------------------------

commit 9e6440d891a6a4a492aabeb37f50b80ce51cd38d
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Jul 29 09:58:39 2018 +0100

    Some local copies


>---------------------------------------------------------------

9e6440d891a6a4a492aabeb37f50b80ce51cd38d
 l3build-help.lua    |   13 +++++++++----
 l3build-stdmain.lua |    5 +++--
 l3build.lua         |    2 +-
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/l3build-help.lua b/l3build-help.lua
index c7050c4..41c1df4 100644
--- a/l3build-help.lua
+++ b/l3build-help.lua
@@ -22,6 +22,11 @@ for those people who are interested.
 
 --]]
 
+local insert = table.insert
+local match  = string.match
+local rep    = string.rep
+local sort   = table.sort
+
 function version()
   print(
     "\n" ..
@@ -32,7 +37,7 @@ end
 
 function help()
   local scriptname = "l3build"
-  if not string.match(arg[0], "l3build(%.lua)$") then
+  if not match(arg[0], "l3build(%.lua)$") then
     scriptname = arg[0]
   end
   print("usage: " .. scriptname .. " <command> [<options>] [<names>]")
@@ -64,12 +69,12 @@ function help()
   -- Sort the options
   local t = { }
   for k,_ in pairs(option_list) do
-    table.insert(t, k)
+    insert(t, k)
   end
-  table.sort(t)
+  sort(t)
   for _,k in ipairs(t) do
     local opt = option_list[k]
-    local filler = string.rep(" ", longest - k:len() + 1)
+    local filler = rep(" ", longest - k:len() + 1)
     if opt["desc"] then -- Skip --help as it has no desc
       if opt["short"] then
         print("   --" .. k .. "|-" .. opt["short"] .. filler .. opt["desc"])
diff --git a/l3build-stdmain.lua b/l3build-stdmain.lua
index 7dac27a..4da72b7 100644
--- a/l3build-stdmain.lua
+++ b/l3build-stdmain.lua
@@ -22,7 +22,8 @@ for those people who are interested.
 
 --]]
 
-local exit             = os.exit
+local exit   = os.exit
+local insert = table.insert
 
 -- List all modules
 function listmodules()
@@ -34,7 +35,7 @@ function listmodules()
       assert(type(attr) == "table")
       if attr.mode == "directory" then
         if not exclmodules[entry] then
-          table.insert(modules, entry)
+          insert(modules, entry)
         end
       end
     end
diff --git a/l3build.lua b/l3build.lua
index 1ded83c..a3bb332 100755
--- a/l3build.lua
+++ b/l3build.lua
@@ -44,7 +44,7 @@ local exit             = os.exit
 
 -- l3build setup and functions
 kpse.set_program_name("kpsewhich")
-build_kpse_path = string.match(lookup("l3build.lua"),"(.*[/])")
+build_kpse_path = match(lookup("l3build.lua"),"(.*[/])")
 local function build_require(s)
   require(lookup("l3build-"..s..".lua", { path = build_kpse_path } ) )
 end





More information about the latex3-commits mailing list