From 637af2c1d85e9620d3a9e8a593bccb7e51b5d125 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 17 May 2013 15:34:55 +0200 Subject: bin/hostinfo: write error messages to stderr --- bin/hostinfo | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/hostinfo b/bin/hostinfo index 88fe388..9caca84 100755 --- a/bin/hostinfo +++ b/bin/hostinfo @@ -115,8 +115,7 @@ def main(): if any([o in opts for o in ['--path', '-p']]): basepath = [opts[o] for o in ['--path', '-p'] if o in opts][0] except getopt.GetoptError, e: - print("Error: %s" % e) - print + sys.stderr.write("Error: %s\n\n" % e) args = [] if hosts: @@ -132,7 +131,7 @@ def main(): path = find_host(basepath, args[0]) if path is None: - print("Host '%s' could not be found!" % args[0]) + sys.stderr.write("Host '%s' could not be found!\n" % args[0]) sys.exit(1) if file: -- cgit v1.2.3-1-g7c22