From 859c572de890218c4b3badd3f0ed67312eaaf20c Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Tue, 28 Feb 2012 01:46:02 -0500 Subject: [PATCH] always show return codes (seems like a reasonable thing to do), make one line output slightly more obvious --- bin/ans-command | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/bin/ans-command b/bin/ans-command index 04ebc82de0..eb494b2ed8 100755 --- a/bin/ans-command +++ b/bin/ans-command @@ -33,8 +33,6 @@ def main(args): parser = base_ans_parser() parser.usage = "ans-command [options] command-to-run" - parser.add_option('-c', '--return-codes', dest='return_codes', action='store_true', - help="prefix each line with the command's return code") parser.add_option('-1', '--one-line', dest='one_line', action='store_true', help="output results on one line to make grepping easier, however will \ not remove newlines from command output") @@ -95,14 +93,9 @@ def main(args): continue if options.one_line: - if options.return_codes: - print '%s:%s:%s:%s' % (hn, d['rc'], d['stdout'], d['stderr']) - else: - print '%s:%s:%s' % (hn, d['stdout'], d['stderr']) + print '%s | rc=%s | %s:%s' % (hn, d['rc'], d['stdout'], d['stderr']) else: - print '%s:' % hn - if options.return_codes: - print 'return code:%s\n' % d['rc'] + print "%s: => rc=%s" % (hn, d['rc']) print '%s' % d['stdout'] if d.get('stderr', None): print '%s' % d['stderr']