allow passing pipeline on stdin

This commit is contained in:
NotAFile 2021-09-29 18:09:17 +02:00
parent b7e7ab2336
commit bd43832eee
1 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,9 @@ def split_commands(tokens):
def main(): def main():
command = sys.argv[1] if len(sys.argv) > 1 else INPUTCMD command = sys.argv[1] if len(sys.argv) > 1 else INPUTCMD
if command.strip() == "-":
command = sys.stdin.read()
oneliner = shlex.shlex(command, posix=True, punctuation_chars=True) oneliner = shlex.shlex(command, posix=True, punctuation_chars=True)
stages = [] stages = []