From acbf21f7db241fa35488fe33afb85a73519b936d Mon Sep 17 00:00:00 2001 From: David Greaves Date: Wed, 30 Mar 2011 22:33:30 +0100 Subject: [PATCH] ci now accepts "-F -" as stdin --- osc/commandline.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index bec08ecd..366f4ca1 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -3332,7 +3332,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. @cmdln.option('-m', '--message', metavar='TEXT', help='specify log message TEXT') @cmdln.option('-F', '--file', metavar='FILE', - help='read log message from FILE') + help='read log message from FILE, \'-\' denotes standard input.') @cmdln.option('-f', '--force', default=False, action="store_true", help='force commit - do not tests a file list') @cmdln.option('--skip-validation', default=False, action="store_true", @@ -3378,10 +3378,13 @@ Please submit there instead, or use --nodevelproject to force direct submission. if opts.message: msg = opts.message elif opts.file: - try: - msg = open(opts.file).read() - except: - sys.exit('could not open file \'%s\'.' % opts.file) + if opts.file == '-': + msg = sys.stdin.read() + else: + try: + msg = open(opts.file).read() + except: + sys.exit('could not open file \'%s\'.' % opts.file) arg_list = args[:] for arg in arg_list: