From a583b395494c86460fbddbd81a2eb37afe05135c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 3 Mar 2012 10:49:03 -0500 Subject: Make the full UUIDs optional for `new` and `comment`. This makes the default output less threatening for new users, while still supplying the full UUIDs for driving BE from external software. --- libbe/command/comment.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libbe/command/comment.py') diff --git a/libbe/command/comment.py b/libbe/command/comment.py index 74521d1..cd04df1 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( @@ -159,7 +161,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 (%s)' % (new.id.user(), new.id.long_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): -- cgit