|
33 | 33 | "--config-file",
|
34 | 34 | metavar="FILE",
|
35 | 35 | required=False,
|
| 36 | + envvar="BUMPVERSION_CONFIG_FILE", |
36 | 37 | type=click.Path(exists=True),
|
37 | 38 | help="Config file to read most of the variables from.",
|
38 | 39 | )
|
|
41 | 42 | "--verbose",
|
42 | 43 | count=True,
|
43 | 44 | required=False,
|
44 |
| - help="Print verbose logging to stderr", |
| 45 | + envvar="BUMPVERSION_VERBOSE", |
| 46 | + help="Print verbose logging to stderr. Can specify several times for more verbosity.", |
45 | 47 | )
|
46 | 48 | @click.option(
|
47 | 49 | "--allow-dirty/--no-allow-dirty",
|
48 | 50 | default=None,
|
49 | 51 | required=False,
|
| 52 | + envvar="BUMPVERSION_ALLOW_DIRTY", |
50 | 53 | help="Don't abort if working directory is dirty, or explicitly abort if dirty.",
|
51 | 54 | )
|
52 | 55 | @click.option(
|
53 | 56 | "--current-version",
|
54 | 57 | metavar="VERSION",
|
55 | 58 | required=False,
|
| 59 | + envvar="BUMPVERSION_CURRENT_VERSION", |
56 | 60 | help="Version that needs to be updated",
|
57 | 61 | )
|
58 | 62 | @click.option(
|
59 | 63 | "--new-version",
|
60 | 64 | metavar="VERSION",
|
61 | 65 | required=False,
|
| 66 | + envvar="BUMPVERSION_NEW_VERSION", |
62 | 67 | help="New version that should be in the files",
|
63 | 68 | )
|
64 | 69 | @click.option(
|
65 | 70 | "--parse",
|
66 | 71 | metavar="REGEX",
|
67 | 72 | required=False,
|
| 73 | + envvar="BUMPVERSION_PARSE", |
68 | 74 | help="Regex parsing the version string",
|
69 | 75 | )
|
70 | 76 | @click.option(
|
71 | 77 | "--serialize",
|
72 | 78 | metavar="FORMAT",
|
73 | 79 | multiple=True,
|
74 | 80 | required=False,
|
| 81 | + envvar="BUMPVERSION_SERIALIZE", |
75 | 82 | help="How to format what is parsed back to a version",
|
76 | 83 | )
|
77 | 84 | @click.option(
|
78 | 85 | "--search",
|
79 | 86 | metavar="SEARCH",
|
80 | 87 | required=False,
|
| 88 | + envvar="BUMPVERSION_SEARCH", |
81 | 89 | help="Template for complete string to search",
|
82 | 90 | )
|
83 | 91 | @click.option(
|
84 | 92 | "--replace",
|
85 | 93 | metavar="REPLACE",
|
86 | 94 | required=False,
|
| 95 | + envvar="BUMPVERSION_REPLACE", |
87 | 96 | help="Template for complete string to replace",
|
88 | 97 | )
|
89 | 98 | @click.option(
|
90 | 99 | "--no-configured-files",
|
91 | 100 | is_flag=True,
|
| 101 | + envvar="BUMPVERSION_NO_CONFIGURED_FILES", |
92 | 102 | help=(
|
93 | 103 | "Only replace the version in files specified on the command line, "
|
94 | 104 | "ignoring the files from the configuration file."
|
|
98 | 108 | "--dry-run",
|
99 | 109 | "-n",
|
100 | 110 | is_flag=True,
|
| 111 | + envvar="BUMPVERSION_DRY_RUN", |
101 | 112 | help="Don't write any files, just pretend.",
|
102 | 113 | )
|
103 | 114 | @click.option(
|
104 | 115 | "--commit/--no-commit",
|
105 | 116 | default=None,
|
| 117 | + envvar="BUMPVERSION_COMMIT", |
106 | 118 | help="Commit to version control",
|
107 | 119 | )
|
108 | 120 | @click.option(
|
109 | 121 | "--tag/--no-tag",
|
110 | 122 | default=None,
|
| 123 | + envvar="BUMPVERSION_TAG", |
111 | 124 | help="Create a tag in version control",
|
112 | 125 | )
|
113 | 126 | @click.option(
|
114 | 127 | "--sign-tags/--no-sign-tags",
|
115 | 128 | default=None,
|
| 129 | + envvar="BUMPVERSION_SIGN_TAGS", |
116 | 130 | help="Sign tags if created",
|
117 | 131 | )
|
118 | 132 | @click.option(
|
119 | 133 | "--tag-name",
|
120 | 134 | metavar="TAG_NAME",
|
121 | 135 | required=False,
|
| 136 | + envvar="BUMPVERSION_TAG_NAME", |
122 | 137 | help="Tag name (only works with --tag)",
|
123 | 138 | )
|
124 | 139 | @click.option(
|
125 | 140 | "--tag-message",
|
126 | 141 | metavar="TAG_MESSAGE",
|
127 | 142 | required=False,
|
| 143 | + envvar="BUMPVERSION_TAG_MESSAGE", |
128 | 144 | help="Tag message",
|
129 | 145 | )
|
130 | 146 | @click.option(
|
131 | 147 | "-m",
|
132 | 148 | "--message",
|
133 | 149 | metavar="COMMIT_MSG",
|
134 | 150 | required=False,
|
| 151 | + envvar="BUMPVERSION_MESSAGE", |
135 | 152 | help="Commit message",
|
136 | 153 | )
|
137 | 154 | @click.option(
|
138 | 155 | "--commit-args",
|
139 | 156 | metavar="COMMIT_ARGS",
|
140 | 157 | required=False,
|
| 158 | + envvar="BUMPVERSION_COMMIT_ARGS", |
141 | 159 | help="Extra arguments to commit command",
|
142 | 160 | )
|
143 | 161 | @click.option(
|
@@ -169,7 +187,16 @@ def cli(
|
169 | 187 | commit_args: Optional[str],
|
170 | 188 | show_list: bool,
|
171 | 189 | ) -> None:
|
172 |
| - """Change the version.""" |
| 190 | + """ |
| 191 | + Change the version. |
| 192 | +
|
| 193 | + VERSION_PART is the part of the version to increase, e.g. `minor` . |
| 194 | + Valid values include those given in the `--serialize` / `--parse` option. |
| 195 | +
|
| 196 | + FILES are additional file(s) to modify. |
| 197 | + If you want to rewrite only files specified on the command line, use with the |
| 198 | + `--no-configured-files` option. |
| 199 | + """ |
173 | 200 | setup_logging(verbose)
|
174 | 201 |
|
175 | 202 | logger.info("Starting BumpVersion %s", __version__)
|
|
0 commit comments