Better --help summaries for install and uninstall

This commit is contained in:
Simon Willison 2022-01-13 16:09:38 -08:00
commit 8f5c44a166
2 changed files with 6 additions and 7 deletions

View file

@ -307,7 +307,7 @@ def package(
"-U", "--upgrade", is_flag=True, help="Upgrade packages to latest version"
)
def install(packages, upgrade):
"""Install Python packages - e.g. Datasette plugins - into the same environment as Datasette"""
"""Install plugins and packages from PyPI into the same environment as Datasette"""
args = ["pip", "install"]
if upgrade:
args += ["--upgrade"]
@ -320,7 +320,7 @@ def install(packages, upgrade):
@click.argument("packages", nargs=-1, required=True)
@click.option("-y", "--yes", is_flag=True, help="Don't ask for confirmation")
def uninstall(packages, yes):
"""Uninstall Python packages (e.g. plugins) from the Datasette environment"""
"""Uninstall plugins and Python packages from the Datasette environment"""
sys.argv = ["pip", "uninstall"] + list(packages) + (["-y"] if yes else [])
run_module("pip", run_name="__main__")

View file

@ -52,11 +52,11 @@ datasette --help
Commands:
serve* Serve up specified SQLite database files with a web UI
inspect Generate JSON summary of provided database files
install Install Python packages - e.g.
install Install plugins and packages from PyPI into the same...
package Package specified SQLite files into a new datasette Docker...
plugins List currently available plugins
publish Publish specified SQLite database files to the internet along...
uninstall Uninstall Python packages (e.g.
uninstall Uninstall plugins and Python packages from the Datasette...
datasette serve --help
@ -335,8 +335,7 @@ datasette install --help
Usage: datasette install [OPTIONS] PACKAGES...
Install Python packages - e.g. Datasette plugins - into the same environment
as Datasette
Install plugins and packages from PyPI into the same environment as Datasette
Options:
-U, --upgrade Upgrade packages to latest version
@ -350,7 +349,7 @@ datasette uninstall --help
Usage: datasette uninstall [OPTIONS] PACKAGES...
Uninstall Python packages (e.g. plugins) from the Datasette environment
Uninstall plugins and Python packages from the Datasette environment
Options:
-y, --yes Don't ask for confirmation