11 lines
248 B
Bash
Executable File
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
|
|
'
|