Allow piping in text to be tooted

pull/31/head
Ivan Habunek 2017-04-19 11:03:44 +02:00
rodzic 042eff339d
commit 2a3d66bae5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -481,6 +481,10 @@ def main():
if os.getenv('TOOT_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
args = sys.argv[2:]