From: W. Trevor King Date: Wed, 8 Jul 2009 02:18:56 +0000 (-0400) Subject: Added new-bug-from-stdin to mirror comments-from-stdin. X-Git-Tag: 1.0.0~64^2~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e5c0d5f2f3f7637cad6baca9e33778d0c054195d;p=be.git Added new-bug-from-stdin to mirror comments-from-stdin. --- diff --git a/becommands/new.py b/becommands/new.py index 32e070a..ec28138 100644 --- a/becommands/new.py +++ b/becommands/new.py @@ -45,7 +45,11 @@ def execute(args, test=False): if len(args) != 1: raise cmdutil.UsageError("Please supply a summary message") bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test) - bug = bd.new_bug(summary=args[0]) + if args[0] == '-': # read summary from stdin + summary = sys.stdin.readline() + else: + summary = args[0] + bug = bd.new_bug(summary=summary.strip()) if options.reporter != None: bug.reporter = options.reporter else: @@ -66,8 +70,9 @@ def get_parser(): return parser longhelp=""" -Create a new bug, with a new ID. The summary specified on the commandline -is a string that describes the bug briefly. +Create a new bug, with a new ID. The summary specified on the +commandline is a string (only one line) that describes the bug briefly +or "-", in which case the string will be read from stdin. """ def help():