HEADS UP: option parsing change underway

David Relson relson at osagesoftware.com
Wed Mar 16 03:23:06 CET 2005


On Wed, 16 Mar 2005 03:03:28 +0100
Matthias Andree wrote:

> David,
> 
> I've started shuffling option parsing code around; sharing longoptions
> (introduced between the years 2004 and 2005) with bogolexer/bogoutil
> seemed like a good idea at first, but turns out to be inadequate, both
> for the user interface and for the maintainability of the code.
> 
> The system as a whole already had bugs WRT --db-checkpoint (my fault),
> --db-transaction (your fault), and ignoring "foreign" options leaves me
> with a very uncomfortable feeling, example:
> 
> bogoutil --bogofilter-dir ~/.bogofilter/wordlist.db
> 
> dumps the database, without error. I intend to rectify this. As a first
> step, I have rearranged the longoptions.c file, as attached. In the
> second step, I will more the common options out to a macro in
> longoptions.h and split the rest into program-specific option
> tables. Options shared by two programs ("foo irrelevant options") will
> also move into longoptions.h as a macro. This allows us to get rid of
> the notoriously out-of-date "ignore options that don't apply to foo"
> lists and of the amiguous options as shown above. Finally, longoptions.c
> will vanish as it will be no longer needed.
> 
> The programs will then no longer tolerate options that do not apply to
> them, which is IMHO sane from a user interface/usability point of view
> (see above for the counter example), the user need not ask himself why a
> particular option appears to have no effect.
> 
> Please no changes near option parsing code, to avoid conflicts.

Looking good so far.  I was about to warn you of the reading of
bogofilter.cf by all programs, but you seem to be taking that into
consideration.

Any objections to holding off on this (and memdebug changes) until I
can release the present code?

_______________________________________________
Bogofilter-dev mailing list
Bogofilter-dev at bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter-dev



More information about the bogofilter-dev mailing list