bump2version
bump2version copied to clipboard
[API] Possible default replace?
The current search always requires a replace if non-standard:
search = stuff{current_version}stuff
replace = stuff{new_version}stuff
If you don't always define replace (to exactly the same thing as search except with {current_version} replaced by {new_version}, then you can't run bump version more than once. Couldn't the default for replace instead be search except with {current_version} replaced by {new_version}? Then it would almost never need to be specified.
Just a thought, sorry if it's come up before!
This looks very appealing to me.
90% of search should not need a custom replace in this way.
The other 10% is when you want to include dynamic things in the replace like environment variables or dates.