Make passing text on comment creation possible
It's now possible to pass the comment text in via CLI by passing using the new `--text` option when creating comments. This increases scriptability. Previously, it was only possible to add text in the editor.
This commit is contained in:
parent
ead0cf51de
commit
fe3d0fc5c6
|
@ -479,13 +479,15 @@ def comment():
|
|||
|
||||
|
||||
@comment.command('create')
|
||||
@click.option('--text', help="Text of the comment. Prompted for in editor if not provided.")
|
||||
@pass_issue
|
||||
@pass_client
|
||||
def comment_create(client, issue):
|
||||
def comment_create(client, issue, text):
|
||||
"""Create a comment on the issue"""
|
||||
# TODO add some help text for the syntax in the description
|
||||
# TODO add all issue info to the description, so we can autocomplete in the
|
||||
# editor
|
||||
if not text:
|
||||
text = prompt(f"Comment text to add as new comment to {issue.key}")
|
||||
client.add_comment(issue.key, text)
|
||||
|
||||
|
|
Loading…
Reference in New Issue