Add --show option to print only the version number
See original GitHub issueExternal tools currently have to use grep
and sed
to extract the version number from the output of bump2version --list
.
bump2version --dry-run --list patch | grep current_version | sed -r s,"^.*=",,
This is long and not very readable. Worse yet, Windows doesn’t offer grep
or sed
unless you install Cygwin/GnuWin32/Linux subsystem for Windows[/…] .
Because it’s a common need, I’d like to see (and can contribute) this instead:
# print current version
>>> bump2version --show
2.11.3
# print current version with modified serialization
>>> bump2version --show --serialize "Release {major}.{minor} patchlevel {patch}."
Release 2.11 patchlevel 3.
# print 'next' (bumped) version
>>> bump2version patch --show
2.11.4
I would propose that show
enforces dry-run
behavior so it never touches physical files. If you want to physically bump the version and also show it, you simply have to call bump2version two times.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:18 (6 by maintainers)
Top Results From Across the Web
Video: More print options - Microsoft Support
Click in Copies and type the number of copies you want to print. Click the arrow next to the current printer and click...
Read more >Solve printing problems on Mac - Apple Support
Click the printer in the Printers list on the right, click Options & Supplies, then check the Driver version. Contact with the printer...
Read more >Command-Line Printing and Options - CUPS.org
The -p option specifies that you want to see a list of printers, and the -d option reports the current default printer or...
Read more >Check Python version on command line and in script
This article describes how to check, get, and print the Python version installed and executed on Windows, Mac, and Linux.
Read more >5.1. Using GHC — Glasgow Haskell Compiler 9.4.3 User's ...
First, create a file hello.hs containing the Haskell code: main = putStrLn "Hello, World!" ... Print a one-line string including GHC's version number....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry it’s slow. I have a working branch but each time I want to make a pull request I’m not sure all the code in there is necessary or understandable.
I’ll aim for end of February for the pull request.
@florisla Hello! It’s useful feature for me. Do you have estimation for it ?