aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/show.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-06 16:15:09 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-06 16:15:09 -0400
commit9e1430329040913810378bdbaf5c9b7919821fd7 (patch)
treeae75ea4881b76db400b59ea86f66549c7dc5bcac /becommands/show.py
parentab1b33b702c4c84a90fd5d7ba8c6dd0078fc303a (diff)
downloadbugseverywhere-9e1430329040913810378bdbaf5c9b7919821fd7.tar.gz
Added "be show --only-raw-body COMMENT-ID".
Diffstat (limited to 'becommands/show.py')
-rw-r--r--becommands/show.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/becommands/show.py b/becommands/show.py
index dfaece1..d72b3a8 100644
--- a/becommands/show.py
+++ b/becommands/show.py
@@ -19,6 +19,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""Show a particular bug"""
+import sys
from libbe import cmdutil, bugdir
__desc__ = __doc__
@@ -79,7 +80,10 @@ def execute(args, test=False):
if options.dumpXML:
print comment.xml(shortname=shortname)
else:
- print comment.string(shortname=shortname)
+ if len(args) == 1 and options.only_raw_body == True:
+ sys.__stdout__.write(comment.body)
+ else:
+ print comment.string(shortname=shortname)
if shortname != args[-1] and options.dumpXML == False:
print "" # add a blank line between bugs/comments
@@ -87,6 +91,8 @@ def get_parser():
parser = cmdutil.CmdOptionParser("be show [options] ID [ID ...]")
parser.add_option("-x", "--xml", action="store_true",
dest='dumpXML', help="Dump as XML")
+ parser.add_option("--only-raw-body", action="store_true",
+ dest='only_raw_body', help="When printing only a single comment, just print it's body. This allows extraction of non-text content types.")
return parser
longhelp="""