mirror of
https://github.com/kennethreitz/clint.git
synced 2026-06-05 23:00:18 +00:00
pipes docs
This commit is contained in:
+2
-2
@@ -5,10 +5,10 @@ import sys
|
||||
__all__ = ('piped_in', )
|
||||
|
||||
def piped_in():
|
||||
"""Returns piped input via stdin, else False."""
|
||||
"""Returns piped input via stdin, else None."""
|
||||
with sys.stdin as stdin:
|
||||
# TTY is only way to detect if stdin contains data
|
||||
if not stdin.isatty():
|
||||
return stdin.read()
|
||||
else:
|
||||
return None
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user