2020-06-21 11:44:00 +00:00
|
|
|
import typer
|
2020-06-21 22:45:40 +00:00
|
|
|
from typer.main import get_command
|
2020-06-21 11:44:00 +00:00
|
|
|
|
|
|
|
|
2020-06-21 22:45:40 +00:00
|
|
|
COMMAND = "python -m spacy"
|
|
|
|
NAME = "spacy"
|
|
|
|
HELP = """spaCy Command-line Interface
|
|
|
|
|
|
|
|
DOCS: https://spacy.io/api/cli
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
app = typer.Typer(name=NAME, help=HELP)
|
|
|
|
|
2020-06-25 10:27:19 +00:00
|
|
|
# Wrappers for Typer's annotations. Initially created to set defaults and to
|
|
|
|
# keep the names short, but not needed at the moment.
|
|
|
|
Arg = typer.Argument
|
|
|
|
Opt = typer.Option
|
2020-06-21 11:44:00 +00:00
|
|
|
|
|
|
|
|
2020-06-21 22:45:40 +00:00
|
|
|
def setup_cli() -> None:
|
|
|
|
# Ensure that the help messages always display the correct prompt
|
|
|
|
command = get_command(app)
|
|
|
|
command(prog_name=COMMAND)
|