diff options
Diffstat (limited to 'osurl')
-rwxr-xr-x | osurl | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -6,7 +6,8 @@ local lpeg = require 'lpeg' local P,C,Cs,Cf,R,S = lpeg.P, lpeg.C, lpeg.Cs, lpeg.Cf, lpeg.R, lpeg.S local tokens = { - NONHASH = C((1 - P("#"))^1), -- any nonempty string not containing # + NONHASH = C((1 - S("#@"))^1), -- any nonempty string not containing # + AT = S("@"), -- @ separator SEP = S("#-"), -- separators, can be # or - NUM = C(R("09")^1), -- nonempty digit string WORD = C(R("AZ","az","09","__")^1), -- nonempty word @@ -26,6 +27,7 @@ local patterns = { ["sr%SEP%NUM"] = "https://build.opensuse.org/request/show/%1", ["jsc%SEP%JIRID"] = "https://jira.suse.com/browse/%1", ["gh%SEP%NONHASH%SEP%WORD"] = "https://github.com/%1/issues/%2", + ["gh%SEP%NONHASH%AT%WORD"] = "https://github.com/%1/commit/%2", ["gl%SEP%NONHASH%SEP%WORD"] = "https://gitlab.com/%1/issues/%2", ["bt%SEP%NONHASH%SEP%WORD"] = "https://bitbucket.org/%1/issues/%2", ["sh%SEP%NUM"] = "http://sourceforge.net/support/tracker.php?aid=%1", @@ -76,6 +78,7 @@ local pat = Cs((bugpat + P(1))^0) local in_url = arg[1] local out_url = pat:match(in_url:lower()) +-- print("out_url = " .. out_url) if out_url == in_url:lower() then out_url = in_url end |