cortav  Diff

Differences From Artifact [bdd85f20a4]:

To Artifact [497f5957f5]:


     7      7   }
     8      8   
     9      9   local function
    10     10   main(input, output, log, mode, suggestions, vars)
    11     11   	local doc = ct.parse(input.stream, input.src, mode)
    12     12   	input.stream:close()
    13     13   	if mode['parse:show-tree'] then
    14         -		log:write(dump(doc))
           14  +		log:write(ss.dump(doc))
    15     15   	end
    16     16   
    17     17   	-- the document has now had a chance to give its say; if it hasn't specified
    18     18   	-- any modes of its own, we now merge in the 'weak modes' (suggestions)
    19     19   	for k,v in pairs(suggestions) do
    20     20   		if not mode[k] then mode[k] = v end
    21     21   	end
................................................................................
   159    159   				if i + nargs > #arg then
   160    160   					ct.exns.cli('not enough arguments for switch --%s (%s expected)', longopt, nargs):throw()
   161    161   				end
   162    162   				local nt = {}
   163    163   				for j = i+1, i+nargs do
   164    164   					table.insert(nt, arg[j])
   165    165   				end
   166         -				print('onsw')
          166  +				onswitch[longopt](table.unpack(nt))
   167    167   			elseif nargs == 1 then
   168    168   				onswitch[longopt](arg[i+1])
   169    169   			else
   170    170   				onswitch[longopt]()
   171    171   			end
   172    172   			i = i + nargs
   173    173   		end
................................................................................
   200    200   		input.stream = file
   201    201   		input.src.file = args[1]
   202    202   	end
   203    203   
   204    204   	return main(input, outp, log, mode, suggestions, vars)
   205    205   end
   206    206   
   207         -local ok, e = pcall(entry_cli)
   208         --- local ok, e = true, entry_cli()
          207  +-- local ok, e = pcall(entry_cli)
          208  +local ok, e = true, entry_cli()
   209    209   if not ok then
   210    210   	local str = 'translation failure'
   211    211   	if ss.exn.is(e) then
   212    212   		str = e.kind.desc
   213    213   	end
   214    214   	local color = false
   215    215   	if log:seek() == nil then