mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Parse roles in the help strings
This commit is contained in:
@@ -18,9 +18,10 @@ type VersionType struct {
|
||||
var VersionString string
|
||||
var Version VersionType
|
||||
var VCSRevision string
|
||||
var WebsiteBaseUrl string
|
||||
|
||||
func init() {
|
||||
var verpat = regexp.MustCompile(`Version\((\d+),\s*(\d+),\s*(\d+)\)`)
|
||||
verpat := regexp.MustCompile(`Version\((\d+),\s*(\d+),\s*(\d+)\)`)
|
||||
matches := verpat.FindStringSubmatch(raw)
|
||||
major, err := strconv.Atoi(matches[1])
|
||||
minor, err := strconv.Atoi(matches[2])
|
||||
@@ -40,5 +41,11 @@ func init() {
|
||||
}
|
||||
}
|
||||
}
|
||||
website_pat := regexp.MustCompile(`website_base_url\s+=\s+['"](.+?)['"]`)
|
||||
matches = website_pat.FindStringSubmatch(raw)
|
||||
WebsiteBaseUrl = matches[1]
|
||||
if matches[1] == "" {
|
||||
panic(fmt.Errorf("Failed to find the website base url"))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user