diff options
-rw-r--r-- | deps.mk | 1 | ||||
-rwxr-xr-x | src/pre | 18 |
2 files changed, 19 insertions, 0 deletions
@@ -4,6 +4,7 @@ sources.sh = \ src/mkdtemp \ src/mkstemp \ src/now \ + src/pre \ src/tempname \ src/timestamp \ src/uuid \ @@ -0,0 +1,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 |