c4urself / bump2version

Version-bump your software with a single command
https://pypi.python.org/pypi/bump2version
MIT License
1.06k stars 134 forks source link

Documented Example Versus Help/Error #130

Closed tinjaw closed 4 years ago

tinjaw commented 4 years ago

Documentation provides the following example:

bump2version [options] part [file]

however, when I run, I get.

bump2version minor usage: bumpversion [-h] [--config-file FILE] [--verbose] [--list] [--allow-dirty] [--parse REGEX] [--serialize FORMAT] [--search SEARCH] [--replace REPLACE] [--current-version VERSION] [--dry-run] --new-version VERSION [--commit | --no-commit] [--tag | --no-tag] [--sign-tags | --no-sign-tags] [--tag-name TAG_NAME] [--tag-message TAG_MESSAGE] [--message COMMIT_MSG] [--commit-args COMMIT_ARGS] part [file [file ...]] bumpversion: error: the following arguments are required: --new-version

It kinda defeats the purpose of automation if I am required to provide the new version number.

florisla commented 4 years ago

Hi, If you don't supply the file argument then you need to use a .bumpversion.cfg configuration file to specify it.

Otherwise, bumpversion does not know which file to modify.

Here's a real example:

File version.txt:

4.2.8

Bump the major part.

Command:

bumpversion --current-version "4.2.8" major "version.txt"

Produces version.txt:

5.0.0

When issue #120 gets fixed, we will be offering lots of examples that clarify usage like this.

tinjaw commented 4 years ago

Hi, If you don't supply the file argument then you need to use a .bumpversion.cfg configuration file to specify it.

Otherwise, bumpversion does not know which file to modify.

I forgot to mention that I am using a .bumpversion.cfg file.

florisla commented 4 years ago

Please share the content of your configuration file.

tinjaw commented 4 years ago

Typed the file name. Sorry.

florisla commented 4 years ago

So you had a [bumpversion:file:] section but with a non-existing file in it? In that case, we should provide a better error message.

tinjaw commented 4 years ago

No. I had bump2version.cfg.

florisla commented 4 years ago

That explains a lot :-)