|
5 | 5 | Throughout this document, you can use `bumpversion` or `bump-my-version` interchangeably.
|
6 | 6 | ```
|
7 | 7 |
|
8 |
| -There are two modes of operation: On the command line for single-file operation |
9 |
| -and using a configuration file (`pyproject.toml`) for more complex multi-file operations. |
| 8 | +There are two modes of operation: On the command line for single-file operation and using a configuration file (`pyproject.toml` or `.bumpversion.toml`) for more complex multi-file processes. |
| 9 | + |
| 10 | +```{admonition} WARNING |
| 11 | +
|
| 12 | +The invocation of `bump-my-version` changed in version 0.6.0. It split functionality into sub-commands. It remains backward-compatible with previous versions. Previous usage is discouraged and may be removed in a 1.0 release. |
| 13 | +``` |
| 14 | +## Incrementing a version |
10 | 15 |
|
11 | 16 | ```console
|
12 |
| -bump-my-version [OPTIONS] [VERSION_PART] [FILES]... |
| 17 | +bump-my-version bump [OPTIONS] [ARGS]... |
13 | 18 | ```
|
14 | 19 |
|
15 |
| -## `VERSION_PART` |
| 20 | +The `bump` sub-command triggers a version increment. The [complete list of options](cli.rst#bumpversion-bump) is available. The `ARGS` may contain a `VERSION_PART` or `FILES` |
| 21 | + |
| 22 | + |
| 23 | +### `VERSION_PART` |
16 | 24 |
|
17 | 25 | _**[optional]**_
|
18 | 26 |
|
19 |
| -The part of the version to increase, e.g. `minor`. |
| 27 | +The part of the version to increase, e.g., `minor`. |
20 | 28 |
|
21 |
| -Valid values include those given in the `--serialize` / `--parse` option. |
| 29 | +Valid values include those given in the [`--serialize`](configuration.md#serialize) / [`--parse`](configuration.md#parse) option. |
22 | 30 |
|
23 | 31 | Example bumping 0.5.1 to 0.6.0:
|
24 | 32 |
|
25 | 33 | ```console
|
26 |
| -bump-my-version --current-version 0.5.1 minor src/VERSION |
| 34 | +bump-my-version bump --current-version 0.5.1 minor src/VERSION |
27 | 35 | ```
|
28 | 36 |
|
29 | 37 |
|
30 |
| -## `FILES` |
| 38 | +### `FILES` |
31 | 39 |
|
32 | 40 | _**[optional]**_<br />
|
33 | 41 | **default**: `None`
|
34 | 42 |
|
35 | 43 | The additional file(s) to modify.
|
36 | 44 |
|
37 |
| -This file is added to the list of files specified in the configuration file. If you want to rewrite only files |
38 |
| -specified on the command line, use `--no-configured-files`. |
| 45 | +This file is added to the list of files specified in the configuration file. If you want to rewrite only files specified on the command line, use `--no-configured-files`. |
39 | 46 |
|
40 | 47 | Example bumping version 1.1.9 to 2.0.0 in the `setup.py` file:
|
41 | 48 |
|
42 | 49 | ```console
|
43 |
| -bump-my-version --current-version 1.1.9 major setup.py |
| 50 | +bump-my-version bump --current-version 1.1.9 major setup.py |
44 | 51 | ```
|
45 | 52 |
|
46 | 53 | Example bumping version 1.1.9 to 2.0.0 in _only_ the `setup.py` file:
|
47 | 54 |
|
48 | 55 | ```console
|
49 |
| -bump-my-version --current-version 1.1.9 --no-configured-files major setup.py |
| 56 | +bump-my-version bump --current-version 1.1.9 --no-configured-files major setup.py |
| 57 | +``` |
| 58 | + |
| 59 | +## Showing configuration information |
| 60 | + |
| 61 | +```console |
| 62 | +bump-my-version show [OPTIONS] [ARGS] |
| 63 | +``` |
| 64 | + |
| 65 | +The `show` subcommand allows you to output the entire or parts of the configuration to the console. The default invocation will output in the default format. The default format changes if one or more than one item is requested. If more than one item is asked for, it outputs the result of Python's `pprint` function. If only one thing is asked for, it outputs that value only. |
| 66 | + |
| 67 | +```console |
| 68 | +$ bump-my-version show current_version |
| 69 | +1.0.0 |
| 70 | +$ bump-my-version show current_version commit |
| 71 | +{'current_version': '1.0.0', 'commit': False} |
| 72 | +``` |
| 73 | + |
| 74 | +You can use the `--increment` option to enable a `new_version` key. |
| 75 | + |
| 76 | +```console |
| 77 | +$ bump-my-version show --increment minor current_version new_version |
| 78 | +{'current_version': '1.0.0', 'new_version': '1.1.0'} |
| 79 | +``` |
| 80 | + |
| 81 | +You can also specify the output to be in JSON or YAML format: |
| 82 | + |
| 83 | +```console |
| 84 | +$ bump-my-version show --format yaml current_version |
| 85 | +current_version: "1.0.0" |
| 86 | +$ bump-my-version show --format yaml current_version commit |
| 87 | +current_version: "1.0.0" |
| 88 | +commit: false |
| 89 | +$ bump-my-version show --format json current_version |
| 90 | +{ |
| 91 | + "current_version": "1.0.0" |
| 92 | +} |
| 93 | +$ bump-my-version show --format json current_version commit |
| 94 | +{ |
| 95 | + "current_version": "1.0.0", |
| 96 | + "commit": false, |
| 97 | +} |
50 | 98 | ```
|
0 commit comments