Skip to content

Commit

Permalink
avoid execute2
Browse files Browse the repository at this point in the history
  • Loading branch information
pyroscope committed Mar 20, 2017
1 parent fc2c3be commit a5a369c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/include-cmd-system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ Call operating system commands, possibly catching their output for use within *r

.. glossary::

execute2
execute.throw
execute.throw.bg
execute2

.. code-block:: ini
execute.throw[.bg] = {command, arg1, arg2, ...} ≫ 0
This will execute a system command with the provided arguments.
These commands either raise an error or return ``0``.
``execute2`` is the same as ``execute.throw``, and should be avoided.

Since internally ``spawn`` is used to call the OS command,
the shell is not involved and things like shell redirection will not work here.
Expand All @@ -46,6 +47,10 @@ Call operating system commands, possibly catching their output for use within *r
execute.nothrow
execute.nothrow.bg

.. code-block:: ini
execute.nothrow[.bg] = {command, arg1, arg2, ...} ≫ value ‹exit status›
Like :term:`execute.throw`, but return the command's exit code
(*warning:* due to a bug the return code is shifted by 8 bits, so ``1`` becomes ``0x100``).

Expand All @@ -56,6 +61,10 @@ Call operating system commands, possibly catching their output for use within *r
execute.capture
execute.capture_nothrow

.. code-block:: ini
execute.capture[_nothrow] = {command, arg1, arg2, ...} ≫ string ‹stdout›
Like ``execute.[no]throw``, but returns the command's standard output.
The ``nothrow`` variant returns any output that was written before an error,
in case one occurs. The exit code is never returned.
Expand Down

0 comments on commit a5a369c

Please sign in to comment.