ParletteSoftware / bitfl

Billy in the Fat Lane
GNU General Public License v3.0
0 stars 0 forks source link

Add versioning #73

Closed cparlette closed 11 years ago

cparlette commented 11 years ago

I debated just printing the version all the time, but for now it just prints the version by reading the top line of version_history.txt if you specify the --version flag.

matthew-parlette commented 11 years ago

Check out the version action in argparse: http://docs.python.org/2.7/library/argparse.html#action

We could possibly condense this down into two lines by using the build in version action.

Also, we may want to load the version regardless of if the user requests a version or not, so if we need to use it elsewhere (like logging), we'll have it available.

I've read about using

with open('filename.txt'):
    #do something

this would work better if someone deleted the version history file by accident.

cparlette commented 11 years ago

@matthew-parlette So if I'm going to print the version every time (which I think is a good idea), should I even add the --version option?

matthew-parlette commented 11 years ago

I think so, it gives you the option of just outputting the version and exiting. I've used this with java before just to see what version I'm on before I do anything.

cparlette commented 11 years ago

@matthew-parlette Try that latest commit, I think it's a little more sane.

matthew-parlette commented 11 years ago

Looks good. You may have said this before, but is version_history.txt created manually? or is there a way to pull in these items from github issues?

cparlette commented 11 years ago

Manually for now, I think we can work on pulling it but it was a little more complex than I planned on getting for now.