From 10f60675807902cd843aad35ec06051e20d99667 Mon Sep 17 00:00:00 2001 From: Alexey Yerin Date: Sat, 23 Jan 2021 00:16:07 +0300 Subject: [PATCH] Rename template-dir to templates-dir Plural makes more sense as there are multiple templates. --- README.md | 16 ++++++++-------- main.go | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b0424c3..5af4b0b 100644 --- a/README.md +++ b/README.md @@ -23,24 +23,24 @@ 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 \ - --static-dir /usr/share/webapps/gtranslate/static + --templates-dir /usr/share/webapps/gtranslate/templates \ + --static-dir /usr/share/webapps/gtranslate/static ``` Other settings (available with `./gtranslate --help`): ``` 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") - --user-agent string User-Agent header to use + -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") + --templates-dir string Templates directory (default "./templates") + --user-agent string User-Agent header to use ``` # Using Tor diff --git a/main.go b/main.go index a4883b4..9fe37f3 100644 --- a/main.go +++ b/main.go @@ -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()