From 441c131db5cc68e197db19f0623ff8a96c90c3ff Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 29 Jan 2019 07:40:34 -0800 Subject: [PATCH] Better --help text for insert command --- sqlite_utils/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sqlite_utils/cli.py b/sqlite_utils/cli.py index b7784d5..bc2e579 100644 --- a/sqlite_utils/cli.py +++ b/sqlite_utils/cli.py @@ -75,7 +75,11 @@ def optimize(path, no_vacuum): @click.option("--csv", is_flag=True, help="Expect CSV") @click.option("--batch-size", type=int, default=100, help="Commit every X records") def insert(path, table, json_file, pk, nl, csv, batch_size): - "Insert records from JSON file into the table, create table if it is missing" + """ + Insert records from JSON file into a table, creating the table if it does not already exist. + + Input should be a JSON array of objects, unless --nl or --csv is used. + """ db = sqlite_utils.Database(path) if nl and csv: click.echo("Use just one of --nl and --csv", err=True)