getopt-long [was: -t output]

David Relson relson at osagesoftware.com
Wed Jul 30 20:17:38 CEST 2003


List:

I accidentally hit send before adding my response.  Sorry :-(

At 12:33 PM 7/30/03, Przemyslaw Brojewski wrote:
>On Wed, Jul 30, 2003 at 09:33:22AM -0400, David Relson wrote:
> > At 09:24 AM 7/30/03, Przemyslaw Brojewski wrote:
> >
> > >It's either single terse format or scripts should have some way of
> > >overriding
> > >bogofilter's config file. Time for getopt-long?
> >
> > Przemyslaw,
> >
> > A script can create and use its own config file.  However there's no easy
> > way to combine a site config with a script config.
> >
> > getopt-long is a possibility.  Would you like to take on the task??
> >
>
>I would. Thank you for te invitation. But there are few reasons that
>I should not:
>- I never used getopt before in an application that would accept more
>   then 5 switches.
>- My programming experience is limited to few years of scripting, mainly
>   in Perl. There happend one apache module years ago, for version 1.2.x,
>   and there was few C-based modules for Perl 5.0, but that's it.
>   Those things were put together in haste and ugly.
>- I'm going for a hoilday this Friday, and won't be back till 25th of
>   September.

Two months vacation!  I'm impressed.

>Anyway, If you are not yet discuraged, I'm going to pretty-print
>bogofilter sources and get familiar with them, while I am away from
>civilisation. My goal would be to add support for something like:
>
>    --config '<a line of config file here>'

Rather than an option that would allow any config file line, I was thinking 
of having a long option for each config option, i.e.

bogofilter --terse_format="%1.1c %f" --spamicity_tags="Yes,No,Unsure"

>This option would be executed after default config file has been
>processed, so Pi's script could do:
>
>bogofilter --config 'terse_format = %1.1c %f' \
>            --config 'spamicity_tags = Yes, No, Unsure' \
>            <some other arguments>
>
>and be happy with whatever user defaults.






More information about the Bogofilter mailing list