Merge pull request #3653 from cafehaine/master

docs: More examples of what SubprocSpec can do
This commit is contained in:
Anthony Scopatz 2020-08-02 10:53:25 -05:00 committed by GitHub
commit ebca1e464f
Failed to generate hash of commit

View file

@ -1268,12 +1268,11 @@ may have one of the following signatures:
"""
import xonsh.proc
if spec.captured in xonsh.proc.STDOUT_CAPTURE_KINDS:
end = ''
print("I'm being captured!")
elif not spec.last_in_pipeline:
print("Going through a pipe!")
else:
end = '\n'
# Now we'll get a newline if the user is at the terminal, and no
# newline if we are captured
print('Hi Mom!', end=end)
print("Hello terminal!")
return 0
def mycmd6(args, stdin=None, stdout=None, stderr=None, spec=None, stack=None):