mirror of
https://github.com/ihabunek/toot
synced 2025-01-24 16:31:49 +01:00
Allow piping in text to be tooted
This commit is contained in:
parent
042eff339d
commit
2a3d66bae5
@ -481,6 +481,10 @@ def main():
|
|||||||
if os.getenv('TOOT_DEBUG'):
|
if os.getenv('TOOT_DEBUG'):
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
|
# If something is piped in, append it to commandline arguments
|
||||||
|
if not sys.stdin.isatty():
|
||||||
|
sys.argv.append(sys.stdin.read())
|
||||||
|
|
||||||
command = sys.argv[1] if len(sys.argv) > 1 else None
|
command = sys.argv[1] if len(sys.argv) > 1 else None
|
||||||
args = sys.argv[2:]
|
args = sys.argv[2:]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user