Skip to content

Commit

Permalink
docs: update CLI usage examples to conform with v8
Browse files Browse the repository at this point in the history
All CLI calls must use a subcommand as the first argument and all flags
must come after the subcommand. See #1143.
  • Loading branch information
sisp authored and yajo committed Jun 15, 2023
1 parent 4cfe6f6 commit 1b351bc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 8 additions & 8 deletions docs/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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 [email protected]:my-company/ci-template.git .
copier copy -a .copier-answers.ci.yml [email protected]:my-company/ci-template.git .
git add .
git commit -m 'Apply internal CI template'
```
Expand All @@ -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
```
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/generating.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b351bc

Please sign in to comment.