aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/comment.py
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/command/comment.py')
-rw-r--r--libbe/command/comment.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/libbe/command/comment.py b/libbe/command/comment.py
index 9695ff6..399d8a7 100644
--- a/libbe/command/comment.py
+++ b/libbe/command/comment.py
@@ -107,6 +107,8 @@ class Comment (libbe.command.Command):
help='Set comment content-type (e.g. text/plain)',
arg=libbe.command.Argument(name='content-type',
metavar='MIME')),
+ libbe.command.Option(name='full-uuid', short_name='f',
+ help='Print the full UUID for the new bug')
])
self.args.extend([
libbe.command.Argument(
@@ -119,9 +121,10 @@ class Comment (libbe.command.Command):
])
def _run(self, **params):
- bugdir = self._get_bugdir()
- bug,parent = \
- libbe.command.util.bug_comment_from_user_id(bugdir, params['id'])
+ bugdirs = self._get_bugdirs()
+ bugdir,bug,parent = (
+ libbe.command.util.bugdir_bug_comment_from_user_id(
+ bugdirs, params['id']))
if params['comment'] == None:
# try to launch an editor for comment-body entry
try:
@@ -159,7 +162,11 @@ class Comment (libbe.command.Command):
for key in ['alt-id', 'author']:
if params[key] != None:
setattr(new, new._setting_name_to_attr_name(key), params[key])
- print >> self.stdout, 'Created comment with ID %s' % new.id.user()
+ if params['full-uuid']:
+ comment_id = new.id.long_user()
+ else:
+ comment_id = new.id.user()
+ self.stdout.write('Created comment with ID %s\n' % (comment_id))
return 0
def _long_help(self):