aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2012-03-03 10:49:03 -0500
committerW. Trevor King <wking@drexel.edu>2012-03-03 10:49:13 -0500
commita583b395494c86460fbddbd81a2eb37afe05135c (patch)
tree41b9669d8c7d8b8ab86d7c751b0798b3dce498ee
parent99f328d8937a173ca4e4f2bb7c46561c675d2d24 (diff)
downloadbugseverywhere-a583b395494c86460fbddbd81a2eb37afe05135c.tar.gz
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.
-rw-r--r--libbe/command/comment.py8
-rw-r--r--libbe/command/new.py8
2 files changed, 14 insertions, 2 deletions
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):
diff --git a/libbe/command/new.py b/libbe/command/new.py
index a847132..725326e 100644
--- a/libbe/command/new.py
+++ b/libbe/command/new.py
@@ -95,6 +95,8 @@ class New (libbe.command.Command):
arg=libbe.command.Argument(
name='severity', metavar='SEVERITY',
completion_callback=libbe.command.util.complete_severity)),
+ libbe.command.Option(name='full-uuid', short_name='f',
+ help='Print the full UUID for the new bug')
])
self.args.extend([
libbe.command.Argument(name='summary', metavar='SUMMARY')
@@ -124,7 +126,11 @@ class New (libbe.command.Command):
bug.severity = params['severity']
bugdir.storage.writeable = True
bug.save()
- print >> self.stdout, 'Created bug with ID %s (%s)' % (bug.id.user(), bug.id.long_user())
+ if params['full-uuid']:
+ bug_id = bug.id.long_user()
+ else:
+ bug_id = bug.id.user()
+ self.stdout.write('Created bug with ID %s\n' % (bug_id))
return 0
def _long_help(self):