1
0
mirror of https://github.com/golang/go synced 2024-11-23 04:50:06 -07:00

unicode: allow version to be passed by env var

This, in turn, to make it work with x/text’s
go generate.

Also eliminates need to manually update version
string in maketables.go.

Change-Id: Id5a8b8e27bdce5b1b5920eb9223a2d27b889149a
Reviewed-on: https://go-review.googlesource.com/63952
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
This commit is contained in:
Marcel van Lohuizen 2017-09-13 17:45:51 +02:00
parent 0bbb6665d8
commit 3dd96e9d82

View File

@ -41,10 +41,17 @@ func main() {
flushOutput()
}
func defaultVersion() string {
if v := os.Getenv("UNICODE_VERSION"); v != "" {
return v
}
return unicode.Version
}
var dataURL = flag.String("data", "", "full URL for UnicodeData.txt; defaults to --url/UnicodeData.txt")
var casefoldingURL = flag.String("casefolding", "", "full URL for CaseFolding.txt; defaults to --url/CaseFolding.txt")
var url = flag.String("url",
"http://www.unicode.org/Public/9.0.0/ucd/",
"http://www.unicode.org/Public/"+defaultVersion()+"/ucd/",
"URL of Unicode database directory")
var tablelist = flag.String("tables",
"all",