vsetka / deepl-translator-cli

This command line tool delivers text translation capabilities to your console and is powered by DeepL (https://www.deepl.com/translator)
MIT License
148 stars 11 forks source link

Allow input retrieval from stdin #1

Closed HQarroum closed 6 years ago

HQarroum commented 6 years ago

Description

This contribution makes it possible for deepl-translator-cli to get a text to translate directly from the standard input in case no text has been given through the command-line arguments.

This makes it particularly handy to use when combined with other command-line tools that we can pipe together.

Usage

# Using pipes.
$ echo "Il fait beau aujourd'hui" | deepl translate -t EN

# Using direct input.
$ deepl translate -t EN
Il fait beau aujourd'hui
^D

# Using input redirection.
$ deepl translate -t EN < input.txt

Types of changes

Pull request checklist

vsetka commented 6 years ago

Looks good. I'll merge and publish a new version even though the commit style is not as prescribed 😉

HQarroum commented 6 years ago

Ok nice. Sorry for the conventional commit style, it's true I did not follow it this time.