Skip to content

Commit

Permalink
cmd-ref: using import.return with experimental configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
pyroscope committed Jun 2, 2018
1 parent 2e5dd9f commit 88e6e7c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/include-cmd-scripting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,22 @@ Importing Script Files
Since this works by throwing an exception, you will see that
exception when called *outside* of an imported file.

To use this in a way compatible with older builds, protect an import like this:

.. rubric:: Example: Quick toggle of experimental configuration

Add a commented ``import.return`` into a configuration file,
above some code you work on, at the very end of the file.
Remove the ``#`` to test that code, put it back to ignore your experiment.

.. code-block:: ini
#import.return=
«here be dragons»
.. rubric:: Example: Protecting imports that use new features

First, protect the import like this (to make it compatible with older builds):

.. code-block:: ini
Expand Down

0 comments on commit 88e6e7c

Please sign in to comment.