Changeset 9 in code


Ignore:
Timestamp:
Feb 11, 2023, 11:04:52 AM (2 years ago)
Author:
koizumi.aoi
Message:

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

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/README

    r7 r9  
    22=====
    33Command-line client for SimplyTranslate in Go.
     4
     5Usage
     6-----
     7-I string
     8        Enter the text to be translated
     9-e string
     10        Translation engine to use (default: google) (default "google")
     11-f string
     12        Set the language to translate from. This can be skipped as it will autodetect the language you're translating from (default "auto")
     13-i string
     14        Instance to use (default: https://simplytranslate.org/api/translate/) (default "https://simplytranslate.org/api/translate/")
     15-t string
     16        Set the language to translate to (default: en) (default "en")
     17
  • trunk/main.go

    r8 r9  
    1 // $KyokoNet: stcli,v 1.3 2022/12/13 23:57:00 akoizumi Exp
     1// $TheSupernovaDuo: stcli,v 1.3.1 2023/02/11 07:54:25 akoizumi Exp
    22// Command line client for SimplyTranslate, a privacy friendly frontend to other translation engines
    33package main
     
    3333        // Check if any of those two variables is empty.
    3434        // It actually needs the two to have content.
    35         if len(input) == 0 || len(to) == 0 {
    36                 log.Fatal("Missing either the text or the target language.")
     35        if len(input) == 0 {
     36                log.Fatal("Missing input.")
    3737        }
    3838        // Map a variable to the struct
     
    4545        sanityCheck(err)
    4646        defer resp.Body.Close()
     47        // JSON decoding
    4748        _ = json.NewDecoder(resp.Body).Decode(&translate)
    4849        sanityCheck(err)
  • trunk/stcli.1

    r7 r9  
    1 .Dd Aftermath 57, 3188
     1.Dd Chaos 42, 3189
    22.Dt STCLI 1
    33.Os
     
    3131.El
    3232.Sh AUTHORS
    33 .An Aoi K. Aq Mt koizumi.aoi@kyoko-project.wer.ee
     33.An Aoi K. Aq Mt koizumi.aoi@chaotic.ninja
    3434.Pp
    3535.An Czar of KST Aq Mt czar@kalli.st
Note: See TracChangeset for help on using the changeset viewer.