Hello all, I received a bug via the debian BTS (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=247180 for details) that essentially said the the quiet switch suppresses too much information. I tend to agree - warnings shouldn't be supressed. While digging around, I also found that some things which I would have thought should go to stdout go to stderr, so I tried to patch output.c. My C skills are extremely rusty - the patch below is kind of rough.
It applies cleanly to 0.72, and appears to work, but you may want to go over it before thinking about applying it. Basically, it redirects all ERROR and WARNING messages to stderr unless --stdout is specified, and everything else goes to stdout, unless --quiet is specified. --verbose is left as it was. Thanks for all your work. -- -------------------------------------------------------------------------- | Stephen Gran | Avoid reality at all costs. | | [EMAIL PROTECTED] | | | http://www.lobefin.net/~steve | | --------------------------------------------------------------------------
--- shared/output.c.old 2004-06-06 13:20:45.000000000 -0400 +++ shared/output.c 2004-06-06 13:48:48.000000000 -0400 @@ -239,8 +239,6 @@ if(mprintf_stdout) fd = stdout; - else - fd = stderr; /* legend: * ! - error @@ -254,16 +252,22 @@ * * verbose yes yes yes * - * quiet yes no no + * quiet yes yes no */ va_start(args, str); if(*str == '!') { + if (fd != stdout) { + fd = stderr; + } fprintf(fd, "ERROR: "); vfprintf(fd, ++str, args); } else if(*str == '@') { + if (fd != stdout) { + fd = stderr; + } fprintf(fd, "ERROR: "); vfprintf(fd, ++str, args); #ifdef NO_SNPRINTF @@ -272,11 +276,17 @@ vsnprintf(logbuf, sizeof(logbuf), str, args); #endif logg("ERROR: %s", logbuf); + } else if(*str == '^') { + if (fd != stdout) { + fd = stderr; + } + fprintf(fd, "WARNING: "); + vfprintf(fd, ++str, args); } else if(!mprintf_quiet) { - if(*str == '^') { - fprintf(fd, "WARNING: "); - vfprintf(fd, ++str, args); - } else if(*str == '*') { + if (fd != stdout) { + fd = stdout; + } + if(*str == '*') { if(mprintf_verbose) vfprintf(fd, ++str, args); } else vfprintf(fd, str, args);
pgp4LsRUl4XqH.pgp
Description: PGP signature