cortav  Diff

Differences From Artifact [bdd85f20a4]:

To Artifact [497f5957f5]:


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
...
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
}

local function
main(input, output, log, mode, suggestions, vars)
	local doc = ct.parse(input.stream, input.src, mode)
	input.stream:close()
	if mode['parse:show-tree'] then
		log:write(dump(doc))
	end

	-- the document has now had a chance to give its say; if it hasn't specified
	-- any modes of its own, we now merge in the 'weak modes' (suggestions)
	for k,v in pairs(suggestions) do
		if not mode[k] then mode[k] = v end
	end
................................................................................
				if i + nargs > #arg then
					ct.exns.cli('not enough arguments for switch --%s (%s expected)', longopt, nargs):throw()
				end
				local nt = {}
				for j = i+1, i+nargs do
					table.insert(nt, arg[j])
				end
				print('onsw')
			elseif nargs == 1 then
				onswitch[longopt](arg[i+1])
			else
				onswitch[longopt]()
			end
			i = i + nargs
		end
................................................................................
		input.stream = file
		input.src.file = args[1]
	end

	return main(input, outp, log, mode, suggestions, vars)
end

local ok, e = pcall(entry_cli)
-- local ok, e = true, entry_cli()
if not ok then
	local str = 'translation failure'
	if ss.exn.is(e) then
		str = e.kind.desc
	end
	local color = false
	if log:seek() == nil then







|







 







|







 







|
|







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
...
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
}

local function
main(input, output, log, mode, suggestions, vars)
	local doc = ct.parse(input.stream, input.src, mode)
	input.stream:close()
	if mode['parse:show-tree'] then
		log:write(ss.dump(doc))
	end

	-- the document has now had a chance to give its say; if it hasn't specified
	-- any modes of its own, we now merge in the 'weak modes' (suggestions)
	for k,v in pairs(suggestions) do
		if not mode[k] then mode[k] = v end
	end
................................................................................
				if i + nargs > #arg then
					ct.exns.cli('not enough arguments for switch --%s (%s expected)', longopt, nargs):throw()
				end
				local nt = {}
				for j = i+1, i+nargs do
					table.insert(nt, arg[j])
				end
				onswitch[longopt](table.unpack(nt))
			elseif nargs == 1 then
				onswitch[longopt](arg[i+1])
			else
				onswitch[longopt]()
			end
			i = i + nargs
		end
................................................................................
		input.stream = file
		input.src.file = args[1]
	end

	return main(input, outp, log, mode, suggestions, vars)
end

-- local ok, e = pcall(entry_cli)
local ok, e = true, entry_cli()
if not ok then
	local str = 'translation failure'
	if ss.exn.is(e) then
		str = e.kind.desc
	end
	local color = false
	if log:seek() == nil then