HEADS UP: option parsing change underway

Matthias Andree matthias.andree at gmx.de
Wed Mar 16 03:03:28 CET 2005


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.

-- 
Matthias Andree
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: longoptions.c
URL: <https://www.bogofilter.org/pipermail/bogofilter-dev/attachments/20050316/06f6f54b/attachment.c>
-------------- next part --------------
_______________________________________________
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