Hash :
eec6d95c
Author :
Thomas de Grivel
Date :
2023-06-13T13:48:47
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 39 40 41 42
## update_header
## Copyright 2022, 2023 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
_ ->
case Regex.run(~r/[.]asd$/, src_path) do
[_] -> Header.CommonLisp
_ -> raise "unknown source file"
end
end
end
end
module.main([src_path | dest])
end
def run(argv) do
update(argv)
end
end