summaryrefslogtreecommitdiff
path: root/src/pre
blob: 7ba0c47c6c2c4a46e6e191c2598a925905194170 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
set -eu

usage() {
	cat <<-'EOF'
		Usage:
		  pre PREFIX < STDIN
	EOF
}


PREFIX="${1:-}"
eval "$(assert-arg -- "$PREFIX" 'PREFIX')"

# FIXME: using "while" so we avoid GNU sed's buffering
while read -r line; do
	printf '%s: %s\n' "$PREFIX" "$line"
done