1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-06-23 06:25:26 +00:00

Don't add stdin contents to arguments if empty

fixes #11
This commit is contained in:
Ivan Habunek 2017-05-07 10:28:11 +02:00
parent 0198bd3af7
commit 02e364b521
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -260,7 +260,9 @@ def main():
# If something is piped in, append it to commandline arguments
if not sys.stdin.isatty():
sys.argv.append(sys.stdin.read())
stdin = sys.stdin.read()
if stdin:
sys.argv.append(stdin)
command_name = sys.argv[1] if len(sys.argv) > 1 else None
args = sys.argv[2:]