Rename template-dir to templates-dir

Plural makes more sense as there are multiple templates.
This commit is contained in:
Alexey Yerin 2021-01-23 00:16:07 +03:00
parent f088cd9d5f
commit 10f6067580
2 changed files with 10 additions and 10 deletions

View File

@ -23,12 +23,12 @@ If you want to use a different port:
```
Note: if you're running it outside of development environment, you
should pass `--template-dir` and `--static-dir` arguments pointing to
should pass `--templates-dir` and `--static-dir` arguments pointing to
templates and static directories:
```sh
./gtranslate \
--template-dir /usr/share/webapps/gtranslate/templates \
--templates-dir /usr/share/webapps/gtranslate/templates \
--static-dir /usr/share/webapps/gtranslate/static
```
@ -39,7 +39,7 @@ Usage of ./gtranslate:
-b, --bind string Address to bind the server to, [addr]:port (default ":5000")
--proxy string Proxy URL, with no scheme http is assumed
--static-dir string Static files directory (default "./static")
--template-dir string Templates directory (default "./templates")
--templates-dir string Templates directory (default "./templates")
--user-agent string User-Agent header to use
```

View File

@ -34,7 +34,7 @@ type TranslateSettings struct {
func main() {
bind := pflag.StringP("bind", "b", ":5000", "Address to bind the server to, [addr]:port")
templateDir := pflag.String("template-dir", "./templates", "Templates directory")
templatesDir := pflag.String("templates-dir", "./templates", "Templates directory")
staticDir := pflag.String("static-dir", "./static", "Static files directory")
proxy := pflag.String("proxy", "", "Proxy URL, with no scheme http is assumed")
userAgent := pflag.String("user-agent", "", "User-Agent header to use")
@ -53,7 +53,7 @@ func main() {
settings := TranslateSettings{proxyUrl, *userAgent}
tmpl := template.Must(template.ParseGlob(path.Join(*templateDir, "*.html")))
tmpl := template.Must(template.ParseGlob(path.Join(*templatesDir, "*.html")))
r := mux.NewRouter()