@@ -92,99 +92,131 @@ are omitted, no result will be printed, and the utility will exit with an error
9292Note: Precedence comparison is NOT a simple lexicographic or numerical comparison - for details please read the Semver.org specification linked at the end of this document.
9393.Ss decrement-major
9494.Nm
95- can decrement the MAJOR component of a Semantic Version
95+ can decrement the MAJOR component of a
9696.Ar version
97- \& .
97+ string .
9898.Pp
9999The MINOR, PATCH, PRERELEASE, and BUILD components will be reset when a decrement occurs.
100100.Pp
101101The formula is:
102102.Dl MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD] -> (MAJOR - 1).0.0
103103.Pp
104+ The operation will fail:
105+ .Bl -bullet -compact
106+ .It
104107If the MAJOR component of
105108.Ar version
106- is 0, the decrement operation will halt, and the utility will exit with an error code.
109+ is already 0.
110+ .It
111+ If
112+ .Ar version
113+ is invalid.
114+ .El
107115.Ss decrement-minor
108116.Nm
109- can decrement the MINOR component of a Semantic Version
117+ can decrement the MINOR component of a
110118.Ar version
111- \& .
119+ string .
112120.Pp
113121The PATCH, PRERELEASE, and BUILD components will be reset when a decrement occurs.
114122.Pp
115123The formula is:
116124.Dl MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD] -> MAJOR.(MINOR - 1).0
117125.Pp
126+ The operation will fail:
127+ .Bl -bullet -compact
128+ .It
118129If the MINOR component of
119130.Ar version
120- is 0, the decrement operation will halt, and the utility will exit with an error code.
131+ is already 0.
132+ .It
133+ If
134+ .Ar version
135+ is invalid.
136+ .El
121137.Ss decrement-patch
122138.Nm
123- can decrement the PATCH component of a Semantic Version
139+ can decrement the PATCH component of a
124140.Ar version
125- \& .
141+ string .
126142.Pp
127143The PRERELEASE and BUILD components will be reset when a decrement occurs.
128144.Pp
129145The formula is:
130146.Dl MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD] -> MAJOR.MINOR.(PATCH - 1)
131147.Pp
148+ The operation will fail:
149+ .Bl -bullet -compact
150+ .It
132151If the PATCH component of
133152.Ar version
134- is 0, the decrement operation will halt, and the utility will exit with an error code.
153+ is already 0.
154+ .It
155+ If
156+ .Ar version
157+ is invalid.
158+ .El
135159.Ss get-major
136160.Nm
137- can get the MAJOR component of a Semantic Version
161+ can get the MAJOR component of a
138162.Ar version
139- \& .
163+ string .
140164.Pp
141- If
165+ The operation will fail if
142166.Ar version
143- is invalid, nothing will be printed, and the utility will exit with an error code .
167+ is invalid.
144168.Ss get-minor
145169.Nm
146- can get the MINOR component of a Semantic Version
170+ can get the MINOR component of a
147171.Ar version
148- \& .
172+ string .
149173.Pp
150174If
151175.Ar version
152176is invalid, nothing will be printed, and the utility will exit with an error code.
153177.Ss get-patch
154178.Nm
155- can get the PATCH component of a Semantic Version
179+ can get the PATCH component of a
156180.Ar version
157- \& .
181+ string .
158182.Pp
159- If
183+ The operation will fail if
160184.Ar version
161- is invalid, nothing will be printed, and the utility will exit with an error code .
185+ is invalid.
162186.Ss get-prerelease
163187.Nm
164- can get the PRERELEASE component of a Semantic Version
188+ can get the PRERELEASE component of a
165189.Ar version
166- \& .
190+ string .
167191.Pp
192+ The operation will fail:
193+ .Bl -bullet -compact
194+ .It
168195If
169196.Ar version
170- does not contain a PRERELEASE, nothing will be printed, and the utility will exit with an error code .
171- .Pp
172- If
197+ does not contain a PRERELEASE.
198+ .It
199+ If
173200.Ar version
174- is invalid, nothing will be printed, and the utility will exit with an error code.
201+ is invalid.
202+ .El
175203.Ss get-build
176204.Nm
177- can get the BUILD component of a Semantic Version
205+ can get the BUILD component of a
178206.Ar version
179- \& .
207+ string .
180208.Pp
209+ The operation will fail:
210+ .Bl -bullet -compact
211+ .It
181212If
182213.Ar version
183- does not contain a BUILD, nothing will be printed, and the utility will exit with an error code .
184- .Pp
185- If
214+ does not contain a BUILD.
215+ .It
216+ If
186217.Ar version
187- is invalid, nothing will be printed, and the utility will exit with an error code.
218+ is invalid.
219+ .El
188220.Ss grep
189221.Nm
190222can parse text from STDIN to extract zero or more Semantic Version strings, in the style of
@@ -194,7 +226,6 @@ can parse text from STDIN to extract zero or more Semantic Version strings, in t
194226A candidate version
195227.Sq string
196228will be matched within the text stream if it meets the following criteria:
197- .Pp
198229.Bl -bullet -compact
199230.It
200231.Sq string
@@ -211,31 +242,49 @@ has whitespace immediately after it, OR its last character is also the last char
211242.El
212243.Ss increment-major
213244.Nm
214- can increment the MAJOR version of a Semantic Version string.
245+ can increment the MAJOR component of a
246+ .Ar version
247+ string.
215248.Pp
216249The MINOR, PATCH, PRERELEASE, and BUILD components will be reset when an increment occurs.
217250.Pp
218251The formula is:
219252.Dl MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD] -> (MAJOR + 1).0.0
253+ .Pp
254+ The operation will fail if
255+ .Ar version
256+ is invalid.
220257.Ss increment-minor
221258.Nm
222- can increment the MINOR version of a Semantic Version string.
259+ can increment the MINOR component of a
260+ .Ar version
261+ string.
223262.Pp
224263The PATCH, PRERELEASE, and BUILD components will be reset when an increment occurs.
225264.Pp
226265The formula is:
227266.Dl MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD] -> MAJOR.(MINOR + 1).0
267+ .Pp
268+ The operation will fail if
269+ .Ar version
270+ is invalid.
228271.Ss increment-patch
229272.Nm
230- can increment the PATCH version of a Semantic Version string.
273+ can increment the PATCH component of a
274+ .Ar version
275+ string.
231276.Pp
232277The PRERELEASE and BUILD components will be reset when an increment occurs.
233278.Pp
234279The formula is:
235280.Dl MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD] -> MAJOR.MINOR.(PATCH + 1)
281+ .Pp
282+ The operation will fail if
283+ .Ar version
284+ is invalid.
236285.Ss init
237286.Nm
238- can print the minimum acceptable Semantic Version
287+ can print the minimum Semantic Version
239288.Sq 0.0.0
240289to STDOUT. You can use this as a base-case initializer, for example in a script which fails to find any Semantic Versions in its input.
241290.Ss sort
0 commit comments