mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 00:14:41 +01:00
Move note about last subprocess (#5592)
Move the note about the last subprocess and return code to the section on Running Commands. When found only in the 'Captured Subprocess' section, it implies that the behavior is only available for captured subprocesses, when in fact it's available for any command. This bit could have gone into its own section, but since it's already carved out as a 'Note', it seems fine to put it here in the Running Commands section. Closes #5591
This commit is contained in:
parent
2142a7b85e
commit
247ecba38a
1 changed files with 5 additions and 5 deletions
|
@ -276,6 +276,11 @@ Running subprocess commands should work like in any other shell.
|
|||
|
||||
This should feel very natural.
|
||||
|
||||
.. note::
|
||||
|
||||
Access the last run subprocess command using ``__xonsh__.last``;
|
||||
e.g. to get the return code, run ``__xonsh__.last.rtn``.
|
||||
|
||||
|
||||
Python-mode vs Subprocess-mode
|
||||
================================
|
||||
|
@ -371,11 +376,6 @@ For example,
|
|||
line characters. You can set ``$XONSH_SUBPROC_OUTPUT_FORMAT`` to ``list_lines``
|
||||
to have a list of distinct lines in the commands like ``du -h $(ls)``.
|
||||
|
||||
.. note::
|
||||
|
||||
You can access a subprocess command you ran using ``__xonsh__.last``
|
||||
e.g. to get the return code run ``__xonsh__.last.rtn``.
|
||||
|
||||
|
||||
The ``!()`` syntax captured more information about the command, as an instance
|
||||
of a class called ``CommandPipeline``. This object contains more information
|
||||
|
|
Loading…
Add table
Reference in a new issue