Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion todoman/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,13 @@ def new(ctx, summary, list, todo_properties, read_description, interactive):

@cli.command()
@pass_ctx
@click.option(
"--read-description",
"-r",
is_flag=True,
default=False,
help="Read task description from stdin.",
)
@click.option(
"--raw",
is_flag=True,
Expand All @@ -392,7 +399,7 @@ def new(ctx, summary, list, todo_properties, read_description, interactive):
@_interactive_option
@with_id_arg
@catch_errors
def edit(ctx, id, todo_properties, interactive, raw):
def edit(ctx, id, todo_properties, interactive, read_description, raw):
"""
Edit the task with id ID.
"""
Expand All @@ -408,6 +415,10 @@ def edit(ctx, id, todo_properties, interactive, raw):
changes = True
setattr(todo, key, value)

if read_description:
changes = True
todo.description = "\n".join(sys.stdin)

if interactive or (not changes and interactive is None):
ui = TodoEditor(todo, ctx.db.lists(), ctx.ui_formatter)
ui.edit()
Expand Down