cli

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App coordinates the translation of structured text using AI language models. It sets up a command-line interface with various options to specify source and target languages, preserve certain terms, apply translation rules, and handle input/output configurations. App encapsulates the logic for reading source content, invoking translation services with the specified parameters, and writing the translated result to either a file or standard output, respecting user-defined timeouts and verbosity settings. It also gracefully handles termination signals to ensure proper cleanup during unexpected exits.

func New

func New(version string) *App

New creates a new instance of App with the provided version and sets up its command-line interface context. It returns a pointer to the created App.

func (*App) Run

func (app *App) Run()

Run starts the application based on the command-line arguments provided. It determines the operation mode (translate or improve), executes the corresponding function, and handles default behavior if no specific command is recognized.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL