From 1b351bc8560d19d70e927cdb2fafb4f7ce41092d Mon Sep 17 00:00:00 2001 From: Sigurd Spieckermann Date: Thu, 15 Jun 2023 09:41:55 +0200 Subject: [PATCH] docs: update CLI usage examples to conform with v8 All CLI calls must use a subcommand as the first argument and all flags must come after the subcommand. See #1143. --- README.md | 2 +- docs/configuring.md | 16 ++++++++-------- docs/faq.md | 2 +- docs/generating.md | 6 +++--- docs/updating.md | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 9597a75fb..c0bb99b73 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ To generate a project from the template: - On the command-line: ```shell - copier path/to/project/template path/to/destination + copier copy path/to/project/template path/to/destination ``` - Or in Python code, programmatically: diff --git a/docs/configuring.md b/docs/configuring.md index 4a20a08d0..b42cd8716 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -757,7 +757,7 @@ questions with default answers. which is overridden, and don't ask user anything else: ```shell - copier -fd 'user_name=Manuel Calavera' copy template destination + copier copy -fd 'user_name=Manuel Calavera' template destination ``` ### `envops` @@ -844,7 +844,7 @@ The CLI option can be passed several times to add several patterns. !!! example "Example CLI usage to copy only a single file from the template" ```shell - copier --exclude '*' --exclude '!file-i-want' copy ./template ./destination + copier copy --exclude '*' --exclude '!file-i-want' ./template ./destination ``` ### `force` @@ -1477,16 +1477,16 @@ mkdir my-project cd my-project git init # Apply framework template -copier -a .copier-answers.main.yml copy https://github.com/example-framework/framework-template.git . +copier copy -a .copier-answers.main.yml https://github.com/example-framework/framework-template.git . git add . git commit -m 'Start project based on framework template' # Apply pre-commit template -copier -a .copier-answers.pre-commit.yml copy https://gitlab.com/my-stuff/pre-commit-template.git . +copier copy -a .copier-answers.pre-commit.yml https://gitlab.com/my-stuff/pre-commit-template.git . git add . pre-commit run -a # Just in case 😉 git commit -am 'Apply pre-commit template' # Apply internal CI template -copier -a .copier-answers.ci.yml copy git@gitlab.example.com:my-company/ci-template.git . +copier copy -a .copier-answers.ci.yml git@gitlab.example.com:my-company/ci-template.git . git add . git commit -m 'Apply internal CI template' ``` @@ -1497,7 +1497,7 @@ After a while, when templates get new releases, updates are handled separately f template: ```shell -copier -a .copier-answers.main.yml update -copier -a .copier-answers.pre-commit.yml update -copier -a .copier-answers.ci.yml update +copier update -a .copier-answers.main.yml +copier update -a .copier-answers.pre-commit.yml +copier update -a .copier-answers.ci.yml ``` diff --git a/docs/faq.md b/docs/faq.md index dd5667990..02d849a0f 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -175,7 +175,7 @@ Well, Copier indeed included that into the `HEAD` ref. However, it still selecte However, if you do this: ```shell -$ copier -r HEAD copy ./src ./dst +$ copier copy -r HEAD ./src ./dst ``` ... then you'll notice `new-file.txt` does exist. You passed a specific ref to copy, so diff --git a/docs/generating.md b/docs/generating.md index fbde67235..2f491dd01 100644 --- a/docs/generating.md +++ b/docs/generating.md @@ -9,7 +9,7 @@ As seen in the quick usage section, you can generate a project from a template u `copier` command-line tool: ```shell -copier path/to/project/template path/to/destination +copier copy path/to/project/template path/to/destination ``` Or within Python code: @@ -54,14 +54,14 @@ other reference to use. For example to use the latest master branch from a public repository: ```shell -copier --vcs-ref master https://github.com/foo/copier-template.git ./path/to/destination +copier copy --vcs-ref master https://github.com/foo/copier-template.git ./path/to/destination ``` Or to work from the current checked out revision of a local template (including dirty changes): ```shell -copier --vcs-ref HEAD path/to/project/template path/to/destination +copier copy --vcs-ref HEAD path/to/project/template path/to/destination ``` ## Regenerating a project diff --git a/docs/updating.md b/docs/updating.md index 178dd9931..887f53794 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -87,14 +87,14 @@ repos: If you want to just reuse all previous answers: ```shell -copier --force update +copier update --force ``` If you want to change just one question, and leave all others untouched, and don't want to go through the whole questionary again: ```shell -copier --force --data updated_question="my new answer" update +copier update --force --data updated_question="my new answer" ``` ## How the update works