nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] semantics of mhshow -type and -part


From: Paul Fox
Subject: Re: [Nmh-workers] semantics of mhshow -type and -part
Date: Tue, 03 Feb 2015 14:32:30 -0500

i've implemented what i think is the right behavior for -part and -type.
the only real change (i think) from past behavior (besides the bug
fix that i set out to take care of) is that if you specify a part
with -part, it will definitely selected to appear in the output.
as in the current codebase, -type switches apply to parts already
selected with -part (or all parts, in the absence of -part) -- i.e.,
they act as a further filter.  specifying a multipart/alternative
part with -part will result in the RFC behavior:  only one subpart
wins.  adding a -type switch can change which part wins.

the behavior that robert elz supported, where multiple -type switches
can get you multiple subparts of a multipart, isn't currently supported. 
it would be trivia to do so, but i haven't yet.  (mulipart/related or
multipart/mixed parts behave that way now, so it's just a matter of
pretending the multipart alternative is something else.)

here's a cut at a manpage-like description of the behavior as i've
implemented it:

    The `-part' switch can be used (one or more times) to restrict the
    set of subparts that will be displayed.  (Obviously with no
    `-part' switches, all parts will be considered.)  If a `-part'
    switch specifies a specific subpart (i.e., a "leaf" in the tree of
    MIME parts), then that part will always be displayed.  If a
    `-part' switch references a multipart/alternative part, then (in
    the absence of a `-type' switch) only the default subpart of that
    multipart will be displayed.  If a `-part' switch references a
    part of type multipart (or if there are no `-part switches at
    all), then the `-type' switch can be used to further restrict
    parts according to content type.  To specify content regardless of
    its subtype, use just the name of the content, e.g., “-type text”. 
    To specify a specific subtype, separate the two with a slash,
    e.g., “-type text/plain”.  Multiple `-type' switches applied to a
    multipart/alternative part will only select the first matching
    subpart.

comments?

paul
=----------------------
 paul fox, address@hidden (arlington, ma, where it's 18.9 degrees)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]