diff --git a/src/verificationbot/cli.py b/src/verificationbot/cli.py index 6d6ba65..264ee9e 100644 --- a/src/verificationbot/cli.py +++ b/src/verificationbot/cli.py @@ -29,9 +29,19 @@ def get_control_group(ac: deltachat.account.Account): help="Specify backup file of your account to initialize account", default=" ", ) +@click.option( + "--verbose", + "-v", + type=bool, + is_flag=True, + help="Show Delta Chat log output", + default=False, +) @click.pass_context -def init(ctx, db_path, from_backup) -> None: +def init(ctx, db_path, from_backup, verbose) -> None: ac = deltachat.account.Account(db_path) + if verbose: + ac.add_account_plugin(deltachat.events.FFIEventLogger(ac)) if not ac.is_configured(): if from_backup != " ": ac.import_all(from_backup) @@ -133,9 +143,19 @@ def get_next_message_from_group( default=os.getenv("HOME") + "/.config/DeltaChat/verificationbot/db.sqlite", show_default=True, ) +@click.option( + "--verbose", + "-v", + type=bool, + is_flag=True, + help="Show Delta Chat log output", + default=False, +) @click.pass_context -def run(ctx, db_path): +def run(ctx, db_path, verbose): ac = deltachat.account.Account(db_path) + if verbose: + ac.add_account_plugin(deltachat.events.FFIEventLogger(ac)) if not ac.is_configured(): ctx.fail( "Please run this first to initialize the bot:\n\n verificationbot init\n"