From 3fa28b44d1ea1d47c480577b9755b7ae34492daa Mon Sep 17 00:00:00 2001 From: Matt Snider Date: Thu, 8 Nov 2018 00:36:51 +0100 Subject: [PATCH] Add basic --interactive capability - confirm each task --- migrate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/migrate.py b/migrate.py index 9f0e69d..110550f 100644 --- a/migrate.py +++ b/migrate.py @@ -18,7 +18,7 @@ def cli(todoist_api_key): @cli.command() -@click.option('-i', '--interactive', default=False) +@click.option('-i', '--interactive', is_flag=True, default=False) @click.option('--no-sync', is_flag=True, default=False) def migrate(interactive, no_sync): if not no_sync: @@ -29,6 +29,9 @@ def migrate(interactive, no_sync): tasks = todoist.items.all() important(f'Starting migration of {len(tasks)}...') for task in todoist.items.all(): + if interactive and not click.confirm(f"Import '{task['content']}'?"): + continue + add_task(task)