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:
14
README
14
README
@@ -1,3 +1,17 @@
|
|||||||
stcli
|
stcli
|
||||||
=====
|
=====
|
||||||
Command-line client for SimplyTranslate in Go.
|
Command-line client for SimplyTranslate in Go.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
-I string
|
||||||
|
Enter the text to be translated
|
||||||
|
-e string
|
||||||
|
Translation engine to use (default: google) (default "google")
|
||||||
|
-f string
|
||||||
|
Set the language to translate from. This can be skipped as it will autodetect the language you're translating from (default "auto")
|
||||||
|
-i string
|
||||||
|
Instance to use (default: https://simplytranslate.org/api/translate/) (default "https://simplytranslate.org/api/translate/")
|
||||||
|
-t string
|
||||||
|
Set the language to translate to (default: en) (default "en")
|
||||||
|
|
||||||
|
|||||||
7
main.go
7
main.go
@@ -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
|
// Command line client for SimplyTranslate, a privacy friendly frontend to other translation engines
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -32,8 +32,8 @@ func main() {
|
|||||||
flag.Parse()
|
flag.Parse()
|
||||||
// Check if any of those two variables is empty.
|
// Check if any of those two variables is empty.
|
||||||
// It actually needs the two to have content.
|
// It actually needs the two to have content.
|
||||||
if len(input) == 0 || len(to) == 0 {
|
if len(input) == 0 {
|
||||||
log.Fatal("Missing either the text or the target language.")
|
log.Fatal("Missing input.")
|
||||||
}
|
}
|
||||||
// Map a variable to the struct
|
// Map a variable to the struct
|
||||||
var translate Translate
|
var translate Translate
|
||||||
@@ -44,6 +44,7 @@ func main() {
|
|||||||
resp, err := http.Get(queryURL)
|
resp, err := http.Get(queryURL)
|
||||||
sanityCheck(err)
|
sanityCheck(err)
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
// JSON decoding
|
||||||
_ = json.NewDecoder(resp.Body).Decode(&translate)
|
_ = json.NewDecoder(resp.Body).Decode(&translate)
|
||||||
sanityCheck(err)
|
sanityCheck(err)
|
||||||
// Pretty-print both the input and the output given.
|
// Pretty-print both the input and the output given.
|
||||||
|
|||||||
4
stcli.1
4
stcli.1
@@ -1,4 +1,4 @@
|
|||||||
.Dd Aftermath 57, 3188
|
.Dd Chaos 42, 3189
|
||||||
.Dt STCLI 1
|
.Dt STCLI 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@@ -30,7 +30,7 @@ Text to translate
|
|||||||
Target language to translate to
|
Target language to translate to
|
||||||
.El
|
.El
|
||||||
.Sh AUTHORS
|
.Sh AUTHORS
|
||||||
.An Aoi K. Aq Mt koizumi.aoi@kyoko-project.wer.ee
|
.An Aoi K. Aq Mt koizumi.aoi@chaotic.ninja
|
||||||
.Pp
|
.Pp
|
||||||
.An Czar of KST Aq Mt czar@kalli.st
|
.An Czar of KST Aq Mt czar@kalli.st
|
||||||
.Pp
|
.Pp
|
||||||
|
|||||||
Reference in New Issue
Block a user