Skip to content

Commit

Permalink
Fix typos on switch task documentation (#172) e326969
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-n committed Oct 16, 2023
1 parent 43d218d commit 059285c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/tasks/task_types/switch.doctree
Binary file not shown.
8 changes: 4 additions & 4 deletions _sources/tasks/task_types/switch.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ This can be used to define a task that runs a different subtask depending on whi
[tool.poe.tasks.build]
control.expr = "sys.platform"
[[tool.poe.tasks.platform_dependent.switch]]
[[tool.poe.tasks.build.switch]]
case = "win32"
cmd = "windows_build"
[[tool.poe.tasks.platform_dependent.switch]]
[[tool.poe.tasks.build.switch]]
cmd = "posix_build"
In the above example the control task is an :doc:`expression <expr>` that checks the value of ``sys.platform``, and if running on windows it'll execute :toml:`windows_build`, otherwise it'll fall back to the default case (i.e. the switch item with no case option defined) and execute :toml:`posix_build`.
Expand Down Expand Up @@ -42,7 +42,7 @@ array of values like so:

.. code-block:: toml
[[tool.poe.tasks.platform_dependent.switch]]
[[tool.poe.tasks.build.switch]]
case = ["linux", "darwin"]
cmd = "build"
Expand All @@ -59,7 +59,7 @@ the switch task to pass and simply do nothing by providing the 'default' option
control.expr = "sys.platform"
default = "pass"
[[tool.poe.tasks.platform_dependent.switch]]
[[tool.poe.tasks.build-on-windows.switch]]
case = "win32"
cmd = "build"
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tasks/task_types/switch.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ <h1><code class="docutils literal notranslate"><span class="pre">switch</span></
<div class="highlight-toml notranslate"><div class="highlight"><pre><span></span><span class="k">[tool.poe.tasks.build]</span>
<span class="n">control</span><span class="p">.</span><span class="n">expr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;sys.platform&quot;</span>

<span class="w"> </span><span class="k">[[tool.poe.tasks.platform_dependent.switch]]</span>
<span class="w"> </span><span class="k">[[tool.poe.tasks.build.switch]]</span>
<span class="w"> </span><span class="n">case</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;win32&quot;</span>
<span class="w"> </span><span class="n">cmd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;windows_build&quot;</span>

<span class="w"> </span><span class="k">[[tool.poe.tasks.platform_dependent.switch]]</span>
<span class="w"> </span><span class="k">[[tool.poe.tasks.build.switch]]</span>
<span class="w"> </span><span class="n">cmd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;posix_build&quot;</span>
</pre></div>
</div>
Expand All @@ -269,7 +269,7 @@ <h2>Available task options<a class="headerlink" href="#available-task-options" t
<h2>Multiple values per case<a class="headerlink" href="#multiple-values-per-case" title="Permalink to this heading">#</a></h2>
<p>It is also possible to define multiple values for a single case option by providing a
array of values like so:</p>
<div class="highlight-toml notranslate"><div class="highlight"><pre><span></span><span class="k">[[tool.poe.tasks.platform_dependent.switch]]</span>
<div class="highlight-toml notranslate"><div class="highlight"><pre><span></span><span class="k">[[tool.poe.tasks.build.switch]]</span>
<span class="n">case</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="s">&quot;linux&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;darwin&quot;</span><span class="p">]</span>
<span class="n">cmd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;build&quot;</span>
</pre></div>
Expand All @@ -284,7 +284,7 @@ <h2>Don’t fail if there’s no match<a class="headerlink" href="#don-t-fail-if
<span class="n">control</span><span class="p">.</span><span class="n">expr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;sys.platform&quot;</span>
<span class="n">default</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;pass&quot;</span>

<span class="w"> </span><span class="k">[[tool.poe.tasks.platform_dependent.switch]]</span>
<span class="w"> </span><span class="k">[[tool.poe.tasks.build-on-windows.switch]]</span>
<span class="w"> </span><span class="n">case</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;win32&quot;</span>
<span class="w"> </span><span class="n">cmd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;build&quot;</span>
</pre></div>
Expand Down

0 comments on commit 059285c

Please sign in to comment.