Hi David, > I just committed that fix to master, please review.
Looking at 28ebf6bb..ff7b97ca, I was puzzled by the macros to make switches disappear. This doesn't affect your patch; it's a general nmh-wide issue. #ifndef OAUTH_SUPPORT # define OAUTHminc(a) (a) #else /* OAUTH_SUPPORT */ # define OAUTHminc(a) 0 #endif /* OAUTH_SUPPORT */ X("oauthclientid client-id", OAUTHminc(-12), OAUTHCLIDSW) \ X("oauthclientsecret client-secret", OAUTHminc(-12), OAUTHCLSECSW) \ 1---to----12 If we *do* have OAUTH then 0 is set for both options. This is a reasonable default that means enough characters for each option have to be specified so there's no ambiguity, and that the option appears in -help's output. It works: $ post -help | grep oauthclient -oauthclientid client-id -oauthclientsecret client-secret $ post -oauthclient post: -oauthclient ambiguous. It matches -oauthclientid client-id -oauthclientsecret client-secret $ post -oauthclientid x -foobar post: -foobar unknown $ If we *don't* have OAUTH then -12 is set for both options, meaning at least twelve characters must be given for each. Given that's how many are needed to resolve ambiguity then it also distinguishes between the two, just like 0, but that it's -12 rather than 12 tells -help to skip printing it. Kind of makes sense; no support so don't show the option. (Alternatively, show them and that they're disabled at build time.) $ post -help | grep oauthclient $ post -oauthclient post: -oauthclient unknown $ post -oauthclientid x -foobar post: -foobar unknown $ It starts off OK; an ambigious, unsupported, option is unknown. That's because smatch() doesn't see the twelve characters demanded. But provide them and the option is happily matched by smatch(), and post.c does the work of stashing the value for the `unsupported' option. I think this is a bug. One last `Huh?'. $ post '-sasl -user' -foobar seen -sasl post: -foobar unknown $ There's no `seen: -user' because smatch() was only called once with "-sasl -user" and said it matched the -sasl switch. I think this is another bug. :-) -- Cheers, Ralph. https://plus.google.com/+RalphCorderoy -- Nmh-workers https://lists.nongnu.org/mailman/listinfo/nmh-workers