Convert to using FILE so stdin can be passed
Thinking about command line options