4 parser
= argparse
.ArgumentParser()
5 parser
.add_argument("src")
6 parser
.add_argument("dst")
7 args
= parser
.parse_known_args()
10 with
open(args
[0].dst
, "r") as f
:
13 cur
= "#if defined(A_HAVE_H)"
14 dst
= os
.path
.dirname(args
[0].src
)
15 src
= os
.path
.basename(args
[0].src
)
16 new
= '#include "{}"\n{}'.format(src
, cur
)
17 text
= text
.replace(cur
, new
)
19 with
open(os
.path
.join(dst
, os
.path
.basename(args
[0].dst
)), "wb") as f
:
20 f
.write(text
.encode())