git @ Cat's Eye Technologies Falderal / master tests / cat.py
master

Tree @master (Download .tar.gz)

cat.py @masterraw · history · blame

# SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
# For more information, please refer to <https://unlicense.org/>
# SPDX-License-Identifier: Unlicense

import sys

input = sys.stdin
output = sys.stdout

if len(sys.argv) > 1 and sys.argv[1] == '-f':
    input = open(sys.argv[2], 'r')
    sys.argv = sys.argv[2:]

if len(sys.argv) > 1 and sys.argv[1] == '-o':
    output = open(sys.argv[2], 'w')
    sys.argv = sys.argv[2:]

output.write(input.read())