uchicago-library / attachment-converter

Attachment Converter: tool for batch converting attachments in an email mailbox
GNU General Public License v2.0
8 stars 3 forks source link

Create Minimal Executable #21

Closed bufordrat closed 2 years ago

bufordrat commented 2 years ago

Create Minimal Executable

You'll notice that our main.ml module currently does nothing except print a message saying that it is converting some attachments.

We will do a full command line interface spec in a later issue, probably using Daniel Buenzli's cmdliner library, but for this issue, the goal is just to get the world's simplest command line executable module up and running, in main.ml. Just splitting the argv list on whitespace should do it for these purposes. (Note that Prelude defines an argv constant in the form of a list, which tends to be easier to work with than the argv array that Stdlib provides. It also provides an argv0 constant, in case you need to make reference to the name under which the utility is run.)

Beyond that, this first stab at an excutable should:

Later on, when we flesh this out into a more mature 'minimum viable product' version of the command line interface, we will probably retain this 'pass one email into stdin and convert attachments in it to stdout' functionality as a way to run the utility, if need be, with the right command line options. It will likely be quite useful to have around for testing.