diff --git a/spacy/__main__.py b/spacy/__main__.py index e539ed78d..a5ba66fee 100644 --- a/spacy/__main__.py +++ b/spacy/__main__.py @@ -61,16 +61,17 @@ class CLI(object): @plac.annotations( input_dir=("directory with model data", "positional", None, str), - output_dir=("output directory", "positional", None, str) + output_dir=("output directory", "positional", None, str), + force=("force overwriting of existing output directory", "flag", "f", bool) ) - def package(self, input_dir, output_dir): + def package(self, input_dir, output_dir, force=False): """ Generate Python package for model data, including meta and required installation files. A new directory will be created in the specified output directory, and model data will be copied over. """ - cli_package(input_dir, output_dir) + cli_package(input_dir, output_dir, force) def __missing__(self, name): diff --git a/spacy/cli/package.py b/spacy/cli/package.py index 9d1ff7183..abd3f6e4e 100644 --- a/spacy/cli/package.py +++ b/spacy/cli/package.py @@ -9,7 +9,7 @@ from .. import about from .. import util -def package(input_dir, output_dir): +def package(input_dir, output_dir, force): input_path = Path(input_dir) output_path = Path(output_dir) check_dirs(input_path, output_path)