Comparison

tools/tb2err @ 13064:b172db27ffed

tools/tb2err: Add some example usage in a comment
author Kim Alvefur <zash@zash.se>
date Sat, 08 Apr 2023 12:54:26 +0200
parent 13063:414952def2d3
child 13065:ab546c5977ed
comparison
equal deleted inserted replaced
13063:414952def2d3 13064:b172db27ffed
1 #!/usr/bin/env lua 1 #!/usr/bin/env lua
2 -- traceback to errors.err for vim -q 2 -- traceback to errors.err for vim -q
3 -- e.g. curl https://prosody.im/paste/xxx | tb2err > errors.err && vim -q
4
3 local path_sep = package.config:sub(1,1); 5 local path_sep = package.config:sub(1,1);
4 for line in io.lines() do 6 for line in io.lines() do
5 local src, err = line:match("%s*(%S+)(:%d+: .*)") 7 local src, err = line:match("%s*(%S+)(:%d+: .*)")
6 if src then 8 if src then
7 src = src:gsub("\\", path_sep); 9 src = src:gsub("\\", path_sep);