From 1891633250d5cb7e342bc9a83a31bae4ba8abbaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=B6hmke?= Date: Sun, 23 Feb 2020 09:51:48 +0100 Subject: [PATCH] updated CLI README.md --- cli/xgotext/README.md | 4 ++-- cli/xgotext/main.go | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cli/xgotext/README.md b/cli/xgotext/README.md index cec5f72..3ec29dd 100644 --- a/cli/xgotext/README.md +++ b/cli/xgotext/README.md @@ -11,7 +11,7 @@ go install github.com/leonelquinteros/gotext/cli/xgotext ## Usage ``` -xgotext /path/to/go/package [/path/to/output/dir] +xgotext -in /path/to/go/package -out /path/to/output/dir ``` ## Implementation @@ -31,7 +31,7 @@ tr := "Translate this string" gotext.Get(tr) ``` -The CLI tool doesn't traverse sub-directories and other packages. +The CLI tool traverse sub-directories based on the given input directory. ## Contribute diff --git a/cli/xgotext/main.go b/cli/xgotext/main.go index fb1125a..1f25c9d 100644 --- a/cli/xgotext/main.go +++ b/cli/xgotext/main.go @@ -20,6 +20,13 @@ func main() { // Init logger log.SetFlags(0) + if *dirName == "" { + log.Fatal("No input directory given") + } + if *outputDir == "" { + log.Fatal("No output directory given") + } + data, err := parser.ParseDirRec(*dirName) if err != nil { log.Fatal(err)