Mercurial > libpst
diff src/pst2ldif.cpp @ 33:12cac756bc05 stable-0-5-5
enable -d option, but if not specified, don't generate a debug file
author | carl |
---|---|
date | Tue, 10 Jul 2007 20:23:55 -0700 |
parents | d64a9df0dc02 |
children | f5c024aa1dc5 |
line wrap: on
line diff
--- a/src/pst2ldif.cpp Tue Jul 10 18:18:38 2007 -0700 +++ b/src/pst2ldif.cpp Tue Jul 10 20:23:55 2007 -0700 @@ -362,10 +362,11 @@ char *fname = NULL; char *temp = NULL; //temporary char pointer char c; + char *d_log = NULL; prog_name = argv[0]; pst_item *item = NULL; - while ((c = getopt(argc, argv, "b:c:Vh"))!= -1) { + while ((c = getopt(argc, argv, "b:c:d:Vh"))!= -1) { switch (c) { case 'b': ldap_base = optarg; @@ -379,6 +380,9 @@ case 'c': ldap_class = optarg; break; + case 'd': + d_log = optarg; + break; case 'h': usage(); exit(0); @@ -402,9 +406,11 @@ } #ifdef DEBUG_ALL - DEBUG_INIT("pst2ldif.log"); - DEBUG_REGISTER_CLOSE(); + // force a log file + if (!d_log) d_log = "pst2ldif.log"; #endif + DEBUG_INIT(d_log); + DEBUG_REGISTER_CLOSE(); DEBUG_ENT("main"); RET_DERROR(pst_open(&pstfile, fname, "r"), 1, ("Error opening File\n")); RET_DERROR(pst_load_index(&pstfile), 2, ("Index Error\n"));