From 15bc3a37b4ace8260fbd11c4d2ad0b25080b28de Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 10 Sep 2020 11:08:15 +0200 Subject: [PATCH] Add --branch to project clone --- spacy/cli/project/clone.py | 5 ++++- website/docs/api/cli.md | 17 +++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/spacy/cli/project/clone.py b/spacy/cli/project/clone.py index a419feb0f..70a640847 100644 --- a/spacy/cli/project/clone.py +++ b/spacy/cli/project/clone.py @@ -16,6 +16,7 @@ def project_clone_cli( name: str = Arg(..., help="The name of the template to clone"), dest: Optional[Path] = Arg(None, help="Where to clone the project. Defaults to current working directory", exists=False), repo: str = Opt(about.__projects__, "--repo", "-r", help="The repository to clone from"), + branch: str = Opt("master", "--branch", "-b", help="The branch to clone from") # fmt: on ): """Clone a project template from a repository. Calls into "git" and will @@ -30,7 +31,9 @@ def project_clone_cli( project_clone(name, dest, repo=repo) -def project_clone(name: str, dest: Path, *, repo: str = about.__projects__) -> None: +def project_clone( + name: str, dest: Path, *, repo: str = about.__projects__, branch: str = "master" +) -> None: """Clone a project template from a repository. name (str): Name of subdirectory to clone. diff --git a/website/docs/api/cli.md b/website/docs/api/cli.md index 0291d6dca..ea61b9ae3 100644 --- a/website/docs/api/cli.md +++ b/website/docs/api/cli.md @@ -893,7 +893,7 @@ can provide any other repo (public or private) that you have access to using the ```cli -$ python -m spacy project clone [name] [dest] [--repo] +$ python -m spacy project clone [name] [dest] [--repo] [--branch] ``` > #### Example @@ -908,13 +908,14 @@ $ python -m spacy project clone [name] [dest] [--repo] > $ python -m spacy project clone template --repo https://github.com/your_org/your_repo > ``` -| Name | Description | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | The name of the template to clone, relative to the repo. Can be a top-level directory or a subdirectory like `dir/template`. ~~str (positional)~~ | -| `dest` | Where to clone the project. Defaults to current working directory. ~~Path (positional)~~ | -| `--repo`, `-r` | The repository to clone from. Can be any public or private Git repo you have access to. ~~str (option)~~ | -| `--help`, `-h` | Show help message and available arguments. ~~bool (flag)~~ | -| **CREATES** | The cloned [project directory](/usage/projects#project-files). | +| Name | Description | +| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | The name of the template to clone, relative to the repo. Can be a top-level directory or a subdirectory like `dir/template`. ~~str (positional)~~ | +| `dest` | Where to clone the project. Defaults to current working directory. ~~Path (positional)~~ | +| `--repo`, `-r` | The repository to clone from. Can be any public or private Git repo you have access to. ~~str (option)~~ | +| `--branch`, `-b` | The branch to clone from. Defaults to `master`. ~~str (option)~~ | +| `--help`, `-h` | Show help message and available arguments. ~~bool (flag)~~ | +| **CREATES** | The cloned [project directory](/usage/projects#project-files). | ### project assets {#project-assets tag="command"}