stockholm/bin/import-statements
2015-05-21 01:56:08 +02:00

11 lines
248 B
Bash
Executable File

#! /bin/sh
# import-statements : lines (path ":" string) |> lines (path ":" relpath)
set -euf
sed -n '
s@^\([^:]\+:\)\('"$(bre-invert-word import)"'\)*\<import\s\+@\1@
t1;d
:1; s@^\([^:]\+:\)\(\.*/\S*\)@\1\2\n@
t2;d
:2; P;D
'