Unix-Style Stream and File Input

For command-line tools that consume one logical stream of records, follow the behaviour associated with Perl's diamond operator <>, even when implementing the tool in another language.

Default interface

producer | analyser
analyser input.txt
analyser first.txt second.txt
producer | analyser first.txt - last.txt

Why

Implementation guidance

When not to force this pattern

Use a different explicit interface when inputs have distinct roles, require random access, must be correlated rather than concatenated, or are unsafe to accept from an unbounded stream. Even then, support - for a single stream-valued input where it remains unambiguous and safe.

version 1  ·  created 2026-09-16  ·  updated 2026-09-16  ·  tags programming, cli, unix, stdin, files, pipelines