summaryrefslogtreecommitdiff
path: root/unidecode/util.py
diff options
context:
space:
mode:
authorTomaz Solc <tomaz.solc@tablix.org>2015-05-14 12:35:42 +0200
committerTomaz Solc <tomaz.solc@tablix.org>2015-05-14 12:35:42 +0200
commit26e53a3e86245caa05e0d5a150764589892a90ba (patch)
treead17c472085945d529717e60991d2fb76618d2e9 /unidecode/util.py
parent87ec07b688b0b2a22a8b120a093b30e63e9e48be (diff)
downloadunidecode-26e53a3e86245caa05e0d5a150764589892a90ba.tar.gz
Add a newline if the string comes from commandline
Diffstat (limited to 'unidecode/util.py')
-rw-r--r--unidecode/util.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/unidecode/util.py b/unidecode/util.py
index b608c7e..477280d 100644
--- a/unidecode/util.py
+++ b/unidecode/util.py
@@ -40,6 +40,10 @@ def main():
stream = os.fsencode(options.text)
else:
stream = options.text
+ # add a newline to the string if it comes from the
+ # command line so that the result is printed nicely
+ # on the console.
+ stream += '\n'.encode('ascii')
else:
if PY3:
stream = sys.stdin.buffer.read()