[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] new module: progname

From: Bruno Haible
Subject: Re: [Bug-gnulib] new module: progname
Date: Wed, 20 Aug 2003 21:16:06 +0200
User-agent: KMail/1.5

Paul Eggert wrote:
> >   /* Set program name for messages.  */
> >   set_program_name (argv[0]);
> >   error_print_progname = maybe_print_progname;
> This advice seems overly complex.  Can we simplify the advice to
> 'set_program_name (argv[0])'?

Sure. I can easily split off the error_print_progname thing into
another module.

> Also, can we avoid having the error_with_progname boolean?
> Applications that want to print program names in error messages can
> invoke set_program_name; applications that don't want it can not
> invoke set_program_name.  That way, we don't need the boolean.
> Or perhaps the boolean was intended to let you switch off the program
> names in some cases, by setting a global variable?

The error_with_progname was intended to turn off the program name in
some situations, namely when the reading from a file and when the
error message starts with the file name.

But really one doesn't need a boolean for this; two functions
print_progname() and print_no_progname() can serve the same purpose.

> extern const char *program_name;
> extern void set_program_name (const char *argv0);
> in the !ENABLE_RELOCATABLE case.

Agreed. I'm committing this module now.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]