Skip to content

Commit 4656863

Browse files
jeffmahoneycrobinso
authored andcommitted
cli: add ability to post comment while sending attachment
This allows the user to post a comment along with an attachment.
1 parent d2cf735 commit 4656863

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

bugzilla.1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ Mime-type for the file being attached
206206
Download the attachment with the given ID
207207
.IP "--getall=BUGID, --get-all=BUGID"
208208
Download all attachments on the given bug
209+
.IP "--comment=COMMENT, -l COMMENT"
210+
Add comment with attachment
209211

210212

211213
.SH \[oq]info\[cq] options

bugzilla/_cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ def _setup_action_attach_parser(subparsers):
414414
default=[], help="Download the attachment with the given ID")
415415
p.add_argument("--getall", "--get-all", metavar="BUGID", action="append",
416416
default=[], help="Download all attachments on the given bug")
417+
p.add_argument('-l', '--comment', '--long_desc',
418+
help="Add comment with attachment")
417419

418420

419421
def _setup_action_login_parser(subparsers):
@@ -1004,6 +1006,8 @@ def _do_set_attach(bz, opt, parser):
10041006
kwargs["contenttype"] = opt.type
10051007
if opt.type in ["text/x-patch"]:
10061008
kwargs["ispatch"] = True
1009+
if opt.comment:
1010+
kwargs["comment"] = opt.comment
10071011
desc = opt.desc or os.path.basename(fileobj.name)
10081012

10091013
# Upload attachments

0 commit comments

Comments
 (0)