summaryrefslogtreecommitdiffstats
path: root/bin/import-statements
blob: 12c8879708b404f273c08a76197341f4573287bc (plain)
1
2
3
4
5
6
7
8
9
10
#! /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
'