From 5839ddb49017804bd724d3ab9dedc272ba2cf3dd Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sun, 1 Aug 2021 14:22:13 -0700 Subject: [PATCH] Do not allow --drop without --output or --multi --- sqlite_utils/cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sqlite_utils/cli.py b/sqlite_utils/cli.py index d2e10cb..9b26e6a 100644 --- a/sqlite_utils/cli.py +++ b/sqlite_utils/cli.py @@ -1987,6 +1987,8 @@ def convert( raise click.ClickException("Cannot use --output with more than one column") if multi and len(columns) > 1: raise click.ClickException("Cannot use --multi with more than one column") + if drop and not (output or multi): + raise click.ClickException("--drop can only be used with --output or --multi") # If single line and no 'return', add the return if "\n" not in code and not code.strip().startswith("return "): code = "return {}".format(code)