def add_note(ctx, item_id, note_format):
""" Add a new note to an existing item. """
if note_format:
ctx.obj.note_format = note_format
try:
item_id = pick_item(ctx.obj, item_id)
except ValueError as e:
ctx.fail(e.args[0])
note_body = click.edit(extension=get_extension(ctx.obj.note_format))
if note_body:
ctx.obj.create_note(item_id, note_body)
评论列表
文章目录