This commit is contained in:
GitHub Actions
2022-07-04 20:46:35 +00:00
parent 6ce0258ca9
commit 2948b4fd4f
3 changed files with 11 additions and 12 deletions
+5 -6
View File
@@ -18,9 +18,7 @@ The following version constructs are currently supported:
.. code-block::
<major> "." <minor> ["." <patch> ["." <tweak>]]
<major> "." <minor> ["." <patch> ["." <tweak>]] [["-"] <pre-release>] ["+" <build>]
<major> "." <minor> ["." <patch> ["." <tweak>]] [["-"] <pre-release> ["." <pre-release> [...]]] ["+" <build> ["." <build> [...]]]
Parsing
^^^^^^^
@@ -31,7 +29,7 @@ Parsing
version(PARSE <out-var> <string>)
Attempts to parse the version in ``<string>`` and stores the individual compoents into ``<out-var>_<component>``. If a component is not present in the given version, it will be undefined. If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message.
Attempts to parse the version in ``<string>`` and stores the individual compoents into ``<out-var>_<component>``. If a component is not present in the given version, it will be undefined. If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message. The ``PRERELEASE`` and ``BUILD`` components support the dot-separation specifier and will be turned into a list if they are encountered.
Generating
^^^^^^^^^^
@@ -42,7 +40,7 @@ Generating
version(GENERATE <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
Generates a version from the components provided and stores the result in ``<out-var>``. The components ``<major>`` and ``<minor>`` will default to ``0`` if not provided. If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message.
Generates a version from the components provided and stores the result in ``<out-var>``. The components ``<major>`` and ``<minor>`` will default to ``0`` if not provided. If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message. The ``PRERELEASE`` and ``BUILD`` components support the dot-separation specifier and will be converted from a list if encountered.
Modifying
^^^^^^^^^
@@ -71,6 +69,7 @@ Compares the version ``<a>`` against ``<b>`` and stores the result in ``<out-var
- If a component is numerical and the value is larger in ``<a>``, ``<out-var>`` will contain the componenent name prefixed by ``>``.
- If a component is numerical and the value is larger in ``<b>``, ``<out-var>`` will contain the componenent name prefixed by ``<``.
- If a component is alphanumerical and the value is different in either, ``<out-var>`` will contain the component name with no prefix.
- In all other cases, ``<out-var>`` will be empty.
- If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message, and ``<out-var>`` will be undefined.
- In all other cases, ``<out-var>`` will be empty.
There is no special handling for dot-separated ``PRERELEASE`` and ``BUILD`` component. They will be treated as if they were a string, as special handling for these is up to the application.
+5 -5
View File
@@ -85,8 +85,7 @@ version(<a class="reference internal" href="#generate">GENERATE</a> &lt;out-var&
version(<a class="reference internal" href="#modify">MODIFY</a> &lt;out-var&gt; &lt;string&gt; [COMPRESS] [MAJOR &lt;major&gt;] [MINOR &lt;minor] [PATCH &lt;patch&gt;] [TWEAK &lt;tweak&gt;] [PRERELEASE &lt;prerelease&gt;] [BUILD &lt;build&gt;])
version(<a class="reference internal" href="#compare">COMPARE</a> &lt;out-var&gt; &lt;a&gt; &lt;b&gt;)</pre>
<p>The following version constructs are currently supported:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">major</span><span class="o">&gt;</span> <span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">minor</span><span class="o">&gt;</span> <span class="p">[</span><span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">patch</span><span class="o">&gt;</span> <span class="p">[</span><span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">tweak</span><span class="o">&gt;</span><span class="p">]]</span>
<span class="o">&lt;</span><span class="n">major</span><span class="o">&gt;</span> <span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">minor</span><span class="o">&gt;</span> <span class="p">[</span><span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">patch</span><span class="o">&gt;</span> <span class="p">[</span><span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">tweak</span><span class="o">&gt;</span><span class="p">]]</span> <span class="p">[[</span><span class="s2">&quot;-&quot;</span><span class="p">]</span> <span class="o">&lt;</span><span class="n">pre</span><span class="o">-</span><span class="n">release</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="s2">&quot;+&quot;</span> <span class="o">&lt;</span><span class="n">build</span><span class="o">&gt;</span><span class="p">]</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">major</span><span class="o">&gt;</span> <span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">minor</span><span class="o">&gt;</span> <span class="p">[</span><span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">patch</span><span class="o">&gt;</span> <span class="p">[</span><span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">tweak</span><span class="o">&gt;</span><span class="p">]]</span> <span class="p">[[</span><span class="s2">&quot;-&quot;</span><span class="p">]</span> <span class="o">&lt;</span><span class="n">pre</span><span class="o">-</span><span class="n">release</span><span class="o">&gt;</span> <span class="p">[</span><span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">pre</span><span class="o">-</span><span class="n">release</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">...</span><span class="p">]]]</span> <span class="p">[</span><span class="s2">&quot;+&quot;</span> <span class="o">&lt;</span><span class="n">build</span><span class="o">&gt;</span> <span class="p">[</span><span class="s2">&quot;.&quot;</span> <span class="o">&lt;</span><span class="n">build</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">...</span><span class="p">]]]</span>
</pre></div>
</div>
</section>
@@ -95,14 +94,14 @@ version(<a class="reference internal" href="#compare">COMPARE</a> &lt;out-var&gt
<div class="highlight-cmake notranslate" id="parse"><div class="highlight"><pre><span></span><span class="nb">version</span><span class="p">(</span><span class="s">PARSE</span><span class="w"> </span><span class="s">&lt;out-var&gt;</span><span class="w"> </span><span class="s">&lt;string&gt;</span><span class="p">)</span>
</pre></div>
</div>
<p>Attempts to parse the version in <code class="docutils literal notranslate"><span class="pre">&lt;string&gt;</span></code> and stores the individual compoents into <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;_&lt;component&gt;</span></code>. If a component is not present in the given version, it will be undefined. If an error occurred, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;_ERROR</span></code> will be defined and contain the error message.</p>
<p>Attempts to parse the version in <code class="docutils literal notranslate"><span class="pre">&lt;string&gt;</span></code> and stores the individual compoents into <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;_&lt;component&gt;</span></code>. If a component is not present in the given version, it will be undefined. If an error occurred, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;_ERROR</span></code> will be defined and contain the error message. The <code class="docutils literal notranslate"><span class="pre">PRERELEASE</span></code> and <code class="docutils literal notranslate"><span class="pre">BUILD</span></code> components support the dot-separation specifier and will be turned into a list if they are encountered.</p>
</section>
<section id="generating">
<h2>Generating<a class="headerlink" href="#generating" title="Permalink to this heading"></a></h2>
<div class="highlight-cmake notranslate" id="generate"><div class="highlight"><pre><span></span><span class="nb">version</span><span class="p">(</span><span class="s">GENERATE</span><span class="w"> </span><span class="s">&lt;out-var&gt;</span><span class="w"> </span><span class="s">[COMPRESS]</span><span class="w"> </span><span class="s">[MAJOR</span><span class="w"> </span><span class="s">&lt;major&gt;]</span><span class="w"> </span><span class="s">[MINOR</span><span class="w"> </span><span class="s">&lt;minor&gt;]</span><span class="w"> </span><span class="s">[PATCH</span><span class="w"> </span><span class="s">&lt;patch&gt;]</span><span class="w"> </span><span class="s">[TWEAK</span><span class="w"> </span><span class="s">&lt;tweak&gt;]</span><span class="w"> </span><span class="s">[PRERELEASE</span><span class="w"> </span><span class="s">&lt;prerelease&gt;]</span><span class="w"> </span><span class="s">[BUILD</span><span class="w"> </span><span class="s">&lt;build&gt;]</span><span class="p">)</span>
</pre></div>
</div>
<p>Generates a version from the components provided and stores the result in <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;</span></code>. The components <code class="docutils literal notranslate"><span class="pre">&lt;major&gt;</span></code> and <code class="docutils literal notranslate"><span class="pre">&lt;minor&gt;</span></code> will default to <code class="docutils literal notranslate"><span class="pre">0</span></code> if not provided. If an error occurred, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;_ERROR</span></code> will be defined and contain the error message.</p>
<p>Generates a version from the components provided and stores the result in <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;</span></code>. The components <code class="docutils literal notranslate"><span class="pre">&lt;major&gt;</span></code> and <code class="docutils literal notranslate"><span class="pre">&lt;minor&gt;</span></code> will default to <code class="docutils literal notranslate"><span class="pre">0</span></code> if not provided. If an error occurred, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;_ERROR</span></code> will be defined and contain the error message. The <code class="docutils literal notranslate"><span class="pre">PRERELEASE</span></code> and <code class="docutils literal notranslate"><span class="pre">BUILD</span></code> components support the dot-separation specifier and will be converted from a list if encountered.</p>
</section>
<section id="modifying">
<h2>Modifying<a class="headerlink" href="#modifying" title="Permalink to this heading"></a></h2>
@@ -123,9 +122,10 @@ version(<a class="reference internal" href="#compare">COMPARE</a> &lt;out-var&gt
<li><p>If a component is numerical and the value is larger in <code class="docutils literal notranslate"><span class="pre">&lt;a&gt;</span></code>, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;</span></code> will contain the componenent name prefixed by <code class="docutils literal notranslate"><span class="pre">&gt;</span></code>.</p></li>
<li><p>If a component is numerical and the value is larger in <code class="docutils literal notranslate"><span class="pre">&lt;b&gt;</span></code>, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;</span></code> will contain the componenent name prefixed by <code class="docutils literal notranslate"><span class="pre">&lt;</span></code>.</p></li>
<li><p>If a component is alphanumerical and the value is different in either, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;</span></code> will contain the component name with no prefix.</p></li>
<li><p>In all other cases, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;</span></code> will be empty.</p></li>
<li><p>If an error occurred, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;_ERROR</span></code> will be defined and contain the error message, and <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;</span></code> will be undefined.</p></li>
<li><p>In all other cases, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;</span></code> will be empty.</p></li>
</ul>
<p>There is no special handling for dot-separated <code class="docutils literal notranslate"><span class="pre">PRERELEASE</span></code> and <code class="docutils literal notranslate"><span class="pre">BUILD</span></code> component. They will be treated as if they were a string, as special handling for these is up to the application.</p>
</section>
</section>
+1 -1
View File
@@ -1 +1 @@
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["version"], "terms": {"pure": 0, "cmake": 0, "support": 0, "semant": 0, "2": 0, "0": 0, "1": 0, "other": 0, "format": 0, "out": 0, "var": 0, "string": 0, "compress": 0, "major": 0, "minor": 0, "patch": 0, "tweak": 0, "prereleas": 0, "build": 0, "b": 0, "The": 0, "follow": 0, "construct": 0, "ar": 0, "current": 0, "pre": 0, "releas": 0, "attempt": 0, "store": 0, "individu": 0, "compoent": 0, "_": 0, "compon": 0, "If": 0, "present": 0, "given": 0, "undefin": 0, "an": 0, "error": 0, "occur": 0, "_error": 0, "defin": 0, "contain": 0, "messag": 0, "from": 0, "provid": 0, "result": 0, "default": 0, "mai": 0, "have": 0, "prefix": 0, "add": 0, "subtract": 0, "valu": 0, "replac": 0, "thi": 0, "oper": 0, "did": 0, "exist": 0, "origin": 0, "ad": 0, "against": 0, "evalu": 0, "order": 0, "should": 0, "expect": 0, "onli": 0, "componen": 0, "name": 0, "numer": 0, "larger": 0, "alphanumer": 0, "differ": 0, "either": 0, "In": 0, "all": 0, "case": 0, "empti": 0}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"version": 0, "synopsi": 0, "pars": 0, "gener": 0, "modifi": 0, "compar": 0}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}})
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["version"], "terms": {"pure": 0, "cmake": 0, "support": 0, "semant": 0, "2": 0, "0": 0, "1": 0, "other": 0, "format": 0, "out": 0, "var": 0, "string": 0, "compress": 0, "major": 0, "minor": 0, "patch": 0, "tweak": 0, "prereleas": 0, "build": 0, "b": 0, "The": 0, "follow": 0, "construct": 0, "ar": 0, "current": 0, "pre": 0, "releas": 0, "attempt": 0, "store": 0, "individu": 0, "compoent": 0, "_": 0, "compon": 0, "If": 0, "present": 0, "given": 0, "undefin": 0, "an": 0, "error": 0, "occur": 0, "_error": 0, "defin": 0, "contain": 0, "messag": 0, "from": 0, "provid": 0, "result": 0, "default": 0, "mai": 0, "have": 0, "prefix": 0, "add": 0, "subtract": 0, "valu": 0, "replac": 0, "thi": 0, "oper": 0, "did": 0, "exist": 0, "origin": 0, "ad": 0, "against": 0, "evalu": 0, "order": 0, "should": 0, "expect": 0, "onli": 0, "componen": 0, "name": 0, "numer": 0, "larger": 0, "alphanumer": 0, "differ": 0, "either": 0, "In": 0, "all": 0, "case": 0, "empti": 0, "dot": 0, "separ": 0, "specifi": 0, "turn": 0, "list": 0, "thei": 0, "encount": 0, "convert": 0, "There": 0, "special": 0, "handl": 0, "treat": 0, "were": 0, "up": 0, "applic": 0}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"version": 0, "synopsi": 0, "pars": 0, "gener": 0, "modifi": 0, "compar": 0}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}})