Hash :
db627c69
Author :
Thomas de Grivel
Date :
2023-01-14T18:20:55
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
## update_header
## Copyright 2022 kmx.io <contact@kmx.io>
defmodule UpdateHeader do
def main(argv) do
IO.puts("update_header #{inspect argv}")
update(argv)
end
def update([]) do
IO.puts("no source")
end
def update([_]) do
IO.puts("no destination")
end
def update([src_path | dest]) do
module = case src_path do
"Makefile" -> Header.Make
"configure" -> Header.Make
"config.subr" -> Header.Make
_ ->
case Regex.run(~r/[.][ch]$/, src_path) do
[_] -> Header.C
_ ->
case Regex.run(~r/[.]exs?$/, src_path) do
[_] -> Header.Make
_ -> raise "error"
end
end
end
module.main([src_path | dest])
end
def run(argv) do
update(argv)
end
end