diff --git a/docs/cli.md b/docs/cli.md index 7946d94e..1e7a9f9f 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -22,9 +22,15 @@ initialize it for the first time, reset it, or download missing data for taxon t Options: ```bash +-d, --download Download taxonomy data if it does not exist locally -f, --force Reset database if it already exists ``` +Example: Full reset and download, with debug logs: +```bash +nt -vv setup db -f -d +``` + ### Shell The `setup shell` command sets up optional shell tab-completion. diff --git a/naturtag/cli.py b/naturtag/cli.py index 8f3d0e36..c1b55fa6 100644 --- a/naturtag/cli.py +++ b/naturtag/cli.py @@ -216,20 +216,32 @@ def setup_group(): @setup_group.command() +@click.option( + '-d', + '--download', + is_flag=True, + help='Download taxonomy data if it does not exist locally', +) @click.option( '-f', '--force', is_flag=True, help='Reset database if it already exists', ) -def db(force): +def db(download, force): """Set up Naturtag's local database. Naturtag uses a SQLite database to store observation and taxonomy data. This command can initialize it for the first time, reset it, or download missing data for taxon text search. + + \b + Example: Full reset and download, with debug logs: + ``` + nt -vv setup db -f -d + ``` """ click.echo('Initializing database...') - setup(overwrite=force) + setup(overwrite=force, download=download) @setup_group.command()