Skip to content

Commit

Permalink
bug fix & update test
Browse files Browse the repository at this point in the history
  • Loading branch information
wtsnjp committed Apr 28, 2018
1 parent 0ebc7d2 commit 1b39901
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions script/config.tlu
Expand Up @@ -142,14 +142,16 @@ function setup_config_from_cl(arg)
local function getopt(arg, options)
local tmp
local tab = {}
local opt_num = 0
for k, v in ipairs(arg) do
local tmp_arg = { table.unpack(arg) }
for k, v in ipairs(tmp_arg) do
if string.sub(v, 1, 2) == "--" then
table.remove(arg, 1)
local x = string.find(v, "=", 1, true)
if x then tab[string.sub(v, 3, x-1)] = string.sub(v, x+1)
else tab[string.sub(v, 3)] = true
end
elseif string.sub(v, 1, 1) == "-" then
table.remove(arg, 1)
local y = 2
local l = string.len(v)
local jopt
Expand All @@ -172,13 +174,7 @@ function setup_config_from_cl(arg)
end
y = y + 1
end
else
for i = 1, opt_num do
table.remove(arg, 1)
end
break
end
opt_num = opt_num + 1
end
return tab
end
Expand Down Expand Up @@ -321,7 +317,7 @@ function confline_to_config(line, file, pos)
end

-- return the list of configuration files
function get_config_files ()
function get_config_files()
-- get names
local platform = string.match (kpse.var_value ('SELFAUTOLOC'), '.*/(.*)$')
local names = {
Expand Down
4 changes: 2 additions & 2 deletions tools/test-basic
Expand Up @@ -31,8 +31,8 @@ my %cl_exit = (
'--files' => 0,
'foobarbaz' => 0,
'--list -M -q texdoc' => 0,
'-I --showall -d texlive-en' => 0,
'-l -I --debug=files texlive-en' => 0,
'--showall -ID texlive-en' => 0,
'-lI -dfiles texlive-en' => 0,
);

# check that the command lines return the right exit code
Expand Down

0 comments on commit 1b39901

Please sign in to comment.