From e5c0d5f2f3f7637cad6baca9e33778d0c054195d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 7 Jul 2009 22:18:56 -0400 Subject: Added new-bug-from-stdin to mirror comments-from-stdin. --- becommands/new.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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(): -- cgit