-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to print machine readable output to stdout #39
Conversation
…0 as default value.
I think bumpversion behaves like other unix tools out there in this respect. Compare
and with muted stderr:
I don't consider verbose logging an error, merely "human readable useful information besides the main output" and that should go to "the other channel that is not stdout" (that is stderr in this case). What are you trying to accomplish ? I certainly want bumpversion to be unixy the way that it prints useful information for other programs to consume, I'm interested in your usecase. |
Also I want bumpversion to support multiple verbosity levels in the future, so that's why it's a count. |
Hi Filip, thanks for the quick response. My usecase is indeed a wrapper script that takes a generated version number from bumpversion (using Under the current implementation I need to redirect the output of the Apart from that, bumpversion is a really nice tool which has been working perfectly so far. |
Yes, let's print machine readable information to stdout (also, maybe with something that would be somehow stable). Maybe similar to what Should be another loglevel in the Python |
The output format of |
Please leave this open as a reminder, feel free to change the attached code on this PR or open another PR if you feel like it.
Happy coding ;) |
I suggest implementing a
This is the minimum it should output. I'm not sure about stuffing all options in it aswell, because that would bloat things up and unless you've overwritten options in .bumpversion.cfg, you have to pass them to the bumpversion command anyway. |
I think 4546e37 should be a good starting point to add more information. I had some issues with the argument parsers so please review my changes and let me know if it's ok. |
Perfect! Two things I've noticed:
Apart from that, I have no objections. Thanks! |
released in v0.4.1 |
When you run bumpversion --verbose, its output gets sent to stderr. This prevents a user to pipe the output into Linux commands like grep without having to redirect stderr to stdout. I don't see a reason why the verbose output should be treated as an error, therefore I'm issuing this pull request.
Furthermore this commit uses False instead of 0 as default value for --verbose, because it's a boolean value and all other options use it too.