Changeset 16 in code
- Timestamp:
- Apr 16, 2023, 2:15:45 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cmd/suwako/main.go
r15 r16 1 // $TheSupernovaDuo: suwako,v 1.5. 0 2023/03/25 10:41:00 akoizumi Exp1 // $TheSupernovaDuo: suwako,v 1.5.1 2023/4/15 23:9:28 yakumo_izuru Exp $ 2 2 // Command line client for SimplyTranslate, a privacy friendly frontend to other translation engines 3 3 package main … … 39 39 40 40 if len(engine) == 0 || len(instance) == 0 { 41 log.Fatal("SUWAKO_ENGINE and/or SUWAKO_INSTANCE are unset") 41 log.Println("SUWAKO_ENGINE and/or SUWAKO_INSTANCE are unset") 42 log.Println("Defaulting to translate.chaotic.ninja with engine 'google'") 43 engine = "google" 44 instance = "https://translate.chaotic.ninja" 42 45 } 43 46 if len(input) == 0 { … … 57 60 _ = json.NewDecoder(resp.Body).Decode(&translate) 58 61 sanityCheck(err) 59 // Pretty-print both the input and the output given. 60 fmt.Printf("Input: %v\n", input) 61 fmt.Printf("Output: %v\n",translate.Output) 62 fmt.Printf("%v\n",translate.Output) 62 63 } 63 64 func sanityCheck(err error) {
Note:
See TracChangeset
for help on using the changeset viewer.