Skip to content

Commit 2d8da16

Browse files
Add support for custom parameters
This adds support for custom parameters in bugzilla modify. This needs to be given in form: key1=val:key2=val:...
1 parent a502f9a commit 2d8da16

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

bugz/cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,15 @@ def modify(settings):
513513
params['version'] = settings.version
514514
if hasattr(settings, 'whiteboard'):
515515
params['whiteboard'] = settings.whiteboard
516+
if hasattr(settings, 'custom'):
517+
custom_options = settings.custom.split(':')
518+
for custom_option in custom_options:
519+
try:
520+
key,value = custom_option.split('=',1)
521+
params[key] = value
522+
except:
523+
print("Badly formatted option :{}".format(custom_option))
524+
pass
516525

517526
if hasattr(settings, 'fixed'):
518527
params['status'] = 'RESOLVED'

bugz/cli_argparser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ def make_arg_parser():
183183
help='change the priority for this bug')
184184
modify_parser.add_argument('--product',
185185
help='change the product for this bug')
186+
modify_parser.add_argument('--custom',
187+
help='change custom parameters for this bug')
186188
modify_parser.add_argument('-r', '--resolution',
187189
help='set new resolution '
188190
'(if status = RESOLVED)')

0 commit comments

Comments
 (0)