Re: [Nmh-workers] "-help" arguments

2016-11-27 Thread David Levine
Norm wrote:

> David Levine  writes:
> >
> >> I wonder if, for 1.7, that simple syntax and semantics could be guaranteed?
> >> That way, it would be possible for *proc commands to be always uptodate.
> >
> >I'm not sure how.  For example, if a new switch is added, its mere
> >existence wouldn't be enough to let a *proc writer know whether or
> >how to use it.
>
> But for most *procs and most proc writers won't it usually be the case
> that he doesn't want to use it per se, but just to know that it might
> be there and how many arguments it takes so that he can ignore it?

I'm still now sure how "it would be possible for *proc commands to
be always uptodate."  My only suggestion would be to parse the -help
output as you'd like, even though there's no guarantee that it won't
change some day.  You can detect that, too.

David

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] "-help" arguments

2016-11-27 Thread norm
David Levine  writes:
>Norm wrote:
>
>> I observe that, ignoring all lines not beginning with exactly two ' '
>> characters, the outputs of nmh's commands' -help, seem to be extremely
>> regular and simple.
>
>Yes, because they're generated from the switch definitions in the code
>of each program.
>
>> I wonder if, for 1.7, that simple syntax and semantics could be guaranteed?
>> That way, it would be possible for *proc commands to be always uptodate.
>
>I'm not sure how.  For example, if a new switch is added, its mere
>existence wouldn't be enough to let a *proc writer know whether or
>how to use it.

But for most *procs and most proc writers won't it usually be the case
that he doesn't want to use it per se, but just to know that it might
be there and how many arguments it takes so that he can ignore it?

I admit that I've written exactly one proc, a postproc. But for it, that
would be the case.

Norman Shapiro

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] "-help" arguments

2016-11-27 Thread David Levine
Norm wrote:

> I observe that, ignoring all lines not beginning with exactly two ' '
> characters, the outputs of nmh's commands' -help, seem to be extremely
> regular and simple.

Yes, because they're generated from the switch definitions in the code
of each program.

> I wonder if, for 1.7, that simple syntax and semantics could be guaranteed?
> That way, it would be possible for *proc commands to be always uptodate.

I'm not sure how.  For example, if a new switch is added, its mere
existence wouldn't be enough to let a *proc writer know whether or
how to use it.  It might help if a switch is removed, but that's
happened how many times in the history of MH and nmh?  And, the
*proc writer would likely have to do more than just notice that it
was removed.

> This would probably require no code changes -- just a line or three in the
> mh-profile man page.

But, it would add an interface that we would have to preserve.
I'm against doing that unless there's a benefit.  In this case, I
don't think there is one.  *proc's just aren't that well defined
(and I don't think this is a good place to start/continue), so the
writer sometimes has to know more than what's explicit in the
documentation already.

David

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


[Nmh-workers] "-help" arguments

2016-11-27 Thread norm
I observe that, ignoring all lines not beginning with exactly two ' '
characters, the outputs of nmh's commands' -help, seem to be extremely
regular and simple.

I wonder if, for 1.7, that simple syntax and semantics could be guaranteed?
That way, it would be possible for *proc commands to be always uptodate.
They would only have to parse the -help output.

This would probably require no code changes -- just a line or three in the
mh-profile man page.

Norman Shapiro

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers