add extra verbose mode which dumps the message contents

i needed that to debug the line ending issues. maybe it will find other
uses as well ...
This commit is contained in:
Oswald Buddenhagen 2010-02-06 10:40:36 +01:00
parent d94dadbaeb
commit e6a356ffc7
4 changed files with 21 additions and 9 deletions

View File

@ -270,7 +270,7 @@ main( int argc, char **argv )
Debug = 1; Debug = 1;
break; break;
case 'V': case 'V':
Verbose = 1; Verbose++;
break; break;
case 'q': case 'q':
Quiet++; Quiet++;
@ -390,7 +390,7 @@ main( int argc, char **argv )
return 0; return 0;
args = 0; args = 0;
add_arg( &args, "mbsync" ); add_arg( &args, "mbsync" );
if (Verbose) while (--Verbose >= 0)
add_arg( &args, "-V" ); add_arg( &args, "-V" );
if (Debug) if (Debug)
add_arg( &args, "-D" ); add_arg( &args, "-D" );

View File

@ -696,6 +696,11 @@ parse_imap_list_l( imap_store_t *ctx, char **sp, list_t **curp, int level )
s += n; s += n;
bytes -= n; bytes -= n;
} }
if (DFlags & XVERBOSE) {
puts( "=========" );
fwrite( cur->val, cur->len, 1, stdout );
puts( "=========" );
}
if (buffer_gets( &ctx->buf, &s )) if (buffer_gets( &ctx->buf, &s ))
goto bail; goto bail;

View File

@ -227,9 +227,10 @@ extern const char *Home;
#define DEBUG 1 #define DEBUG 1
#define VERBOSE 2 #define VERBOSE 2
#define QUIET 4 #define XVERBOSE 4
#define VERYQUIET 8 #define QUIET 8
#define KEEPJOURNAL 16 #define VERYQUIET 16
#define KEEPJOURNAL 32
extern int DFlags, Ontty; extern int DFlags, Ontty;

View File

@ -265,9 +265,12 @@ main( int argc, char **argv )
DFlags |= VERYQUIET; DFlags |= VERYQUIET;
else else
DFlags |= QUIET; DFlags |= QUIET;
} else if (!strcmp( opt, "verbose" )) } else if (!strcmp( opt, "verbose" )) {
if (DFlags & VERBOSE)
DFlags |= XVERBOSE;
else
DFlags |= VERBOSE | QUIET; DFlags |= VERBOSE | QUIET;
else if (!strcmp( opt, "debug" )) } else if (!strcmp( opt, "debug" ))
DFlags |= DEBUG | QUIET; DFlags |= DEBUG | QUIET;
else if (!strcmp( opt, "pull" )) else if (!strcmp( opt, "pull" ))
cops |= XOP_PULL, mvars->ops[M] |= XOP_HAVE_TYPE; cops |= XOP_PULL, mvars->ops[M] |= XOP_HAVE_TYPE;
@ -424,6 +427,9 @@ main( int argc, char **argv )
DFlags |= QUIET; DFlags |= QUIET;
break; break;
case 'V': case 'V':
if (DFlags & VERBOSE)
DFlags |= XVERBOSE;
else
DFlags |= VERBOSE | QUIET; DFlags |= VERBOSE | QUIET;
break; break;
case 'D': case 'D':