Skip to content

Commit

Permalink
add -o option for writing dependent list to files
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjr committed Nov 22, 2024
1 parent dbca5ca commit fb12873
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions texfindpkg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ local function queryOne(t, name)
end
end

local outfile = nil

local function query(namelist)
for _, v in ipairs(namelist) do
queryOne(v[1], v[2])
Expand All @@ -539,6 +541,11 @@ local function query(namelist)
else
tfpRealPrint(dist .. " packages not yet installed in total: " .. pkgs)
end
if outfile then
--print(outfile)
pkgs = concat(totaldeplist, "\n")
fileWrite(pkgs, outfile)
end
end
end

Expand Down Expand Up @@ -592,12 +599,18 @@ end
local function readArgList(arglist)
local reallist = {}
local isinput = false
local isoutput = false
for _, v in ipairs(arglist) do
if isinput then
reallist = readArgsInFile(reallist, v)
isinput = false
elseif isoutput then
outfile = v
isoutput = false
elseif v == "-i" then
isinput = true
elseif v == "-o" then
isoutput = true
else
insert(reallist, v)
end
Expand Down

0 comments on commit fb12873

Please sign in to comment.