Rename template-dir to templates-dir
Plural makes more sense as there are multiple templates.
This commit is contained in:
parent
f088cd9d5f
commit
10f6067580
|
@ -23,12 +23,12 @@ If you want to use a different port:
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: if you're running it outside of development environment, you
|
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:
|
templates and static directories:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./gtranslate \
|
./gtranslate \
|
||||||
--template-dir /usr/share/webapps/gtranslate/templates \
|
--templates-dir /usr/share/webapps/gtranslate/templates \
|
||||||
--static-dir /usr/share/webapps/gtranslate/static
|
--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")
|
-b, --bind string Address to bind the server to, [addr]:port (default ":5000")
|
||||||
--proxy string Proxy URL, with no scheme http is assumed
|
--proxy string Proxy URL, with no scheme http is assumed
|
||||||
--static-dir string Static files directory (default "./static")
|
--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
|
--user-agent string User-Agent header to use
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
4
main.go
4
main.go
|
@ -34,7 +34,7 @@ type TranslateSettings struct {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bind := pflag.StringP("bind", "b", ":5000", "Address to bind the server to, [addr]:port")
|
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")
|
staticDir := pflag.String("static-dir", "./static", "Static files directory")
|
||||||
proxy := pflag.String("proxy", "", "Proxy URL, with no scheme http is assumed")
|
proxy := pflag.String("proxy", "", "Proxy URL, with no scheme http is assumed")
|
||||||
userAgent := pflag.String("user-agent", "", "User-Agent header to use")
|
userAgent := pflag.String("user-agent", "", "User-Agent header to use")
|
||||||
|
@ -53,7 +53,7 @@ func main() {
|
||||||
|
|
||||||
settings := TranslateSettings{proxyUrl, *userAgent}
|
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()
|
r := mux.NewRouter()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue