lkml.org 
[lkml]   [2010]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] get_maintainer.pl: improve config-file support
On Wed, 12 May 2010 15:28:53 -0700
Joe Perches <joe@perches.com> wrote:

> On Wed, 2010-05-12 at 23:12 +0200, florian@mickler.org wrote:
> > This changes the syntax of the config-file introduced in the commit
> > "scripts/get_maintainer.pl: add .get_maintainer.conf default options
> > file".
> > Entries are now of the more commonly found form:
> > key = value
> > where keys are cmd-line arguments without the "--" prefixed.
>
> I don't have a strong opinion one way or another about the
> .conf file format.
>
> Another option which could be useful: --noconf, don't read the file.
>
> > as well as warn if unrecognized options are
> > specified.
>
> The old approach does that as well.

True.

>
> > +if (!GetOptions( \%prefs,
>
> I think you don't need to repeat the options.
> Doesn't this work?
> if (!GetOptions(\%prefs)) {
> die "$P: invalid argument - use --help if necessary\n";
>
No, GetOpts::Long needs a special markup for parsing the cmdline
string, like =s for specifying that that option is accompanied by a
string value or the ! for specifying that it is a flag.
Also there are aliases defined for config-options.

Cheers,
Flo

p.s.: maybe there is a GetOpts feature to use config-files?


\
 
 \ /
  Last update: 2010-05-13 09:59    [W:0.033 / U:4.624 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site