summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/pre18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pre b/src/pre
new file mode 100755
index 0000000..7ba0c47
--- /dev/null
+++ b/src/pre
@@ -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