s4-ldb: add --trace command line option to ldb tools
authorAndrew Tridgell <tridge@samba.org>
Mon, 21 Sep 2009 22:24:39 +0000 (15:24 -0700)
committerAndrew Tridgell <tridge@samba.org>
Mon, 21 Sep 2009 22:27:05 +0000 (15:27 -0700)
This enabled LDB_FLG_ENABLE_TRACING

source4/lib/ldb/tools/cmdline.c
source4/lib/ldb/tools/cmdline.h

index 8541106060c3de0af61ab719fc3d624346e9240d..73bf2a93a758792aef1f87a2546d173bdd29de3e 100644 (file)
@@ -44,6 +44,7 @@ static struct poptOption popt_options[] = {
        { "editor",    'e', POPT_ARG_STRING, &options.editor, 0, "external editor", "PROGRAM" },
        { "scope",     's', POPT_ARG_STRING, NULL, 's', "search scope", "SCOPE" },
        { "verbose",   'v', POPT_ARG_NONE, NULL, 'v', "increase verbosity", NULL },
+       { "trace",     0,   POPT_ARG_NONE, &options.tracing, 0, "enable tracing", NULL },
        { "interactive", 'i', POPT_ARG_NONE, &options.interactive, 0, "input from stdin", NULL },
        { "recursive", 'r', POPT_ARG_NONE, &options.recursive, 0, "recursive delete", NULL },
        { "modules-path", 0, POPT_ARG_STRING, &options.modules_path, 0, "modules path", "PATH" },
@@ -220,6 +221,10 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb,
                flags |= LDB_FLG_SHOW_BINARY;
        }
 
+       if (options.tracing) {
+               flags |= LDB_FLG_ENABLE_TRACING;
+       }
+
 #if (_SAMBA_BUILD_ >= 4)
        /* Must be after we have processed command line options */
        gensec_init(cmdline_lp_ctx); 
index 9f728fba0bd77e1015f740dd5447c9a748f3288d..28061a5a7d6d2206bf2d508d839500549768dada 100644 (file)
@@ -45,6 +45,7 @@ struct ldb_cmdline {
        const char *output;
        char **controls;
        int show_binary;
+       int tracing;
 };
 
 struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int argc, const char **argv,