]> Devi Nivas Git - chevron.git/commitdiff
Remove extra newline from cli
authorNoah Morrison <noah@morrison.ph>
Fri, 20 Jul 2018 23:58:35 +0000 (19:58 -0400)
committerNoah Morrison <noah@morrison.ph>
Fri, 20 Jul 2018 23:58:35 +0000 (19:58 -0400)
The render function already handles adding a newline

chevron/main.py

index 1a7a8dfb9aa04c31482cc553ed1d89f419f150b2..649e776b217a21e44b410c3bf146458fa350b3e7 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/bin/python
 
+import sys
+
 try:
     import yaml as json
 except ImportError:  # not tested
@@ -78,7 +80,8 @@ def cli_main():
     args = vars(parser.parse_args())
 
     try:
-        print(main(**args))
+        sys.stdout.write(main(**args))
+        sys.stdout.flush()
     except SyntaxError as e:
         print('Chevron: syntax error')
         print('    ' + '\n    '.join(e.args[0].split('\n')))