-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The MailcapHandler currently can't deal with positional arguments #430
Comments
This changes the `MailcapHandler` to support commands with positional arguments. The patch removes the additional types and uses the re-exports from `System.Process.Typed` instead. I did not see any reason why we would need the additional overhead. Instead of types, the handler is now a function which accepts the mail as input to allow crafting whatever command is necessary. Fixes #430
Yeah. I'd like proper parsing of the mailcap format (https://datatracker.ietf.org/doc/html/rfc1524), and associated functions for preparing the subprocess given mailcap entry and body/part content. Possibly belongs in a separate library but we can extract later if it seems useful. |
I've actually changed the type to a function (see https://github.com/purebred-mua/purebred/compare/feat/430/mailcaphandler-can-work-with-positional-arguments) which gets me what I want. However I agree, that better support for the mailcap file is the better approach, so we don't have to add this manually. |
I'm giving a mailcap parser a shot. Named the package |
@romanofski you should be able to reuse a bunch of the low-level parsers from purebred-email. Identify the useful subset and then we'll see if it makes sense to extract another package (purebred-parsing or whatever). |
@frasertweedale yeah I'm already using it as a reference. Thanks for the pointer! |
Is your feature request related to a problem? Please describe.
The current
MailcapHandler
we use doesn't support positional arguments. For examplepdftotext
has the following synopsis:pdftotext [options] [PDF-file [text-file]]
. I'd need something to represent our input file, which currently was just appended. However the last argument here needs to be thetext-file
which is typicallystdout
, so the typical template becomes:pdftotext %s -
.Describe the solution you'd like
Haven't thought about it yet.
Describe alternatives you've considered
None
Additional context
I'd be keen to use
pdftotext
so I can view attached PDFs.The text was updated successfully, but these errors were encountered: