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

75 make email backend configurable #93

Closed bufordrat closed 4 months ago

bufordrat commented 5 months ago

This PR addresses #75.

I decided not to make the email parsing backend configurable via the application config, because doing so would mean complicating the syntax of the config file. That is, there would now have to be able to be two types of stanzas in the config file: one to tell Attachment Converter about a conversion the user would like it to perform, and one determining global application settings. That felt like a lot of work for not much gain.

So for now, the email parsing backend can be changed on the command line with the following option:

$ attc --backend=mrmime --single-email < /path/to/email
$ attc --backend=ocamlnet --single-email < /path/to/email

When no backend parameter is given, Attachment Converter defaults to using OCamlnet.

One further addendum: I deleted some test code that the compiler told me wasn't being used. Feel free to ask me to put it back in if you need it.

bufordrat commented 5 months ago

Forgot to mention: I also put the Git hook with the autoformatter into this branch.

To make Git run the autoformatting hook whenever it commits (when you're in this project specifically), run the following command at the root of the project:

$ git config --local core.hooksPath .githooks/

As a result of the autoformatting, a lot of the diffs you'll see in this PR are whitespace-only. Annoying, but should be the last time that happens project-wide.