aboutsummaryrefslogtreecommitdiffstats
path: root/osurl
diff options
context:
space:
mode:
Diffstat (limited to 'osurl')
-rwxr-xr-xosurl6
1 files changed, 5 insertions, 1 deletions
diff --git a/osurl b/osurl
index dc83dfd..f6672c1 100755
--- a/osurl
+++ b/osurl
@@ -6,8 +6,9 @@ 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 - S("#@"))^1), -- any nonempty string not containing #
+ NONHASH = C((1 - S("#!@"))^1), -- any nonempty string not containing #
AT = S("@"), -- @ separator
+ DOL = 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
@@ -28,6 +29,7 @@ local patterns = {
["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",
+ ["gh%SEP%NONHASH%DOL%WORD"] = "https://github.com/%1/discussions/%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",
@@ -77,10 +79,12 @@ end
local pat = Cs((bugpat + P(1))^0)
local in_url = arg[1]
+-- print("in_url = " .. in_url)
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
+-- print("out_url = " .. out_url)
os.execute("xdg-open " .. out_url)