steal some ideas for parsing filenames from latexmk
line endings LOL