doc: target language is no longer required, put usage notes on readme.

git-svn-id: file:///srv/svn/repo/suwako/trunk@9 0b558ee1-521d-8b46-a41b-40029c97c055
This commit is contained in:
koizumi.aoi
2023-02-11 11:04:52 +00:00
parent 1d2d7d2020
commit 860fe77744
3 changed files with 20 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
// $KyokoNet: stcli,v 1.3 2022/12/13 23:57:00 akoizumi Exp
// $TheSupernovaDuo: stcli,v 1.3.1 2023/02/11 07:54:25 akoizumi Exp
// Command line client for SimplyTranslate, a privacy friendly frontend to other translation engines
package main
@@ -32,8 +32,8 @@ func main() {
flag.Parse()
// Check if any of those two variables is empty.
// It actually needs the two to have content.
if len(input) == 0 || len(to) == 0 {
log.Fatal("Missing either the text or the target language.")
if len(input) == 0 {
log.Fatal("Missing input.")
}
// Map a variable to the struct
var translate Translate
@@ -44,6 +44,7 @@ func main() {
resp, err := http.Get(queryURL)
sanityCheck(err)
defer resp.Body.Close()
// JSON decoding
_ = json.NewDecoder(resp.Body).Decode(&translate)
sanityCheck(err)
// Pretty-print both the input and the output given.