ploeh / ZeroToNine

A tool for maintaining .NET Assembly versions across multiple files.
MIT License
147 stars 16 forks source link

Assign a version part a value whilst retaining existing version part values #20

Closed russcam closed 10 years ago

russcam commented 10 years ago

Allow assignment operation to assign a new value to a version part of an existing version whilst retaining the values of the other version parts.

Usage:

Existing assembly version: 1.5.0.0 Command: Zero29 -a build 20 New assembly version: 1.5.20.0

ploeh commented 10 years ago

Thank you for your contribution! It looks good, but I left a couple of questions here and there.

russcam commented 10 years ago

I've added a partial active pattern to ensure that the Args type AssignRank value is matched only when the argument passed for rank number is an integer greater than or equal to 0, as per the System.Version documentation.

ploeh commented 10 years ago

Thank you for your contribution! It's now live as Zero29 0.6.0 and ZeroToNine.

I particularly enjoyed the use of a partial active pattern. Although I've been using F# for some time now, I'm still no master, and so far, I've managed to stay ignorant of active patterns :$ Now I get it, so thank you for teaching me something today :D

russcam commented 10 years ago

No problem, happy to contribute!

I'm looking at implementing the other way that I suggested for assigning version numbers, namely, with a version-like pattern such as 1...20.

I read a couple of F# books several years ago but haven't ever really dived into it; I'm using this as an opportunity to become more acquainted, if that's ok :)