callowayproject / bump-my-version

A small command line tool to simplify releasing software by updating all version strings in your source code by the correct increment and optionally commit and tag the changes.
https://callowayproject.github.io/bump-my-version/
MIT License
349 stars 21 forks source link

Print current version #195

Closed mradecki closed 5 months ago

mradecki commented 5 months ago

Description

I would like to retrieve current version from .bumpmyversion and get it stripped to stdout, like:

> bump-my-version show current
> 1.0.7

It seems obvious to have such functionality, where is it?

What I Did

I did various approaches bump-my-version show | sed/awk I wrote a script that parses .bumpversion.toml and retrieves it.

So I have this working, but it just feels wrong

coordt commented 5 months ago

You almost had it:

bump-my-version show current_version
mradecki commented 5 months ago

Thanks for quick response @coordt !

I knew it must exists somwhere :smile:

Is it documented anywhere?I couldn't find it help or in github README


❯ bump-my-version show --help

 Usage: bump-my-version show [OPTIONS] [ARGS]...                                                                

 Show current configuration information.                                                                        

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --config-file      FILE                 Config file to read most of the variables from.                      │
│ --format       -f  [default|yaml|json]  Config file to read most of the variables from.                      │
│ --increment    -i  TEXT                 Increment the version part and add `new_version` to the              │
│                                         configuration.                                                       │
│ --help         -h                       Show this message and exit.                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
coordt commented 5 months ago

I thought I had, but I can't find it in the docs. I guess I know what I'm doing today...

coordt commented 5 months ago

I've added improved documentation for the show command. I need to do the others, as well, but I keep getting sidetracked.