diff options
author | W. Trevor King <wking@drexel.edu> | 2009-07-07 22:18:56 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-07-07 22:18:56 -0400 |
commit | e5c0d5f2f3f7637cad6baca9e33778d0c054195d (patch) | |
tree | 503dd298813c933e7222845191201055825cd071 /becommands/new.py | |
parent | 9e1430329040913810378bdbaf5c9b7919821fd7 (diff) | |
download | bugseverywhere-e5c0d5f2f3f7637cad6baca9e33778d0c054195d.tar.gz |
Added new-bug-from-stdin to mirror comments-from-stdin.
Diffstat (limited to 'becommands/new.py')
-rw-r--r-- | becommands/new.py | 11 |
1 files 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(): |