show the full set of command line options for ldb tools
authorAndrew Tridgell <tridge@samba.org>
Wed, 2 Sep 2009 08:31:22 +0000 (18:31 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 2 Sep 2009 08:31:59 +0000 (18:31 +1000)
I always found it hard to remember some of the options. We might as
well use popt to give us the full list

source4/lib/ldb/tools/ldbadd.c
source4/lib/ldb/tools/ldbdel.c
source4/lib/ldb/tools/ldbedit.c
source4/lib/ldb/tools/ldbmodify.c
source4/lib/ldb/tools/ldbrename.c

index be02334797fa4e4f21f47901f0343d23fc274e21..086540dfdf55e2631f2b7e3703fe1d8829e6cb7e 100644 (file)
@@ -38,13 +38,9 @@ static int failures;
 
 static void usage(void)
 {
-       printf("Usage: ldbadd <options> <ldif...>\n");
-       printf("Options:\n");
-       printf("  -H ldb_url       choose the database (or $LDB_URL)\n");
-       printf("  -o options       pass options like modules to activate\n");
-       printf("              e.g: -o modules:timestamps\n");
-       printf("\n");
+       printf("Usage: ldbadd <options> <ldif...>\n");  
        printf("Adds records to a ldb, reading ldif the specified list of files\n\n");
+       ldb_cmdline_help("ldbadd", stdout);
        exit(1);
 }
 
index 232f51681a9fcfba431aab4cdbc1b31f3005440c..ddf168d5746321bf872843a59bf5bb47d499cd9d 100644 (file)
@@ -61,13 +61,8 @@ static int ldb_delete_recursive(struct ldb_context *ldb, struct ldb_dn *dn)
 static void usage(void)
 {
        printf("Usage: ldbdel <options> <DN...>\n");
-       printf("Options:\n");
-       printf("  -r               recursively delete the given subtree\n");
-       printf("  -H ldb_url       choose the database (or $LDB_URL)\n");
-       printf("  -o options       pass options like modules to activate\n");
-       printf("              e.g: -o modules:timestamps\n");
-       printf("\n");
        printf("Deletes records from a ldb\n\n");
+       ldb_cmdline_help("ldbdel", stdout);
        exit(1);
 }
 
index 9d3bd27983a11af5a449195bcb0d2a0a68a4384c..9653eabcb9c3bdf92e557f68cfe7c691c4f894b5 100644 (file)
@@ -270,13 +270,7 @@ static int do_edit(struct ldb_context *ldb, struct ldb_message **msgs1, int coun
 static void usage(void)
 {
        printf("Usage: ldbedit <options> <expression> <attributes ...>\n");
-       printf("Options:\n");
-       printf("  -H ldb_url       choose the database (or $LDB_URL)\n");
-       printf("  -s base|sub|one  choose search scope\n");
-       printf("  -b basedn        choose baseDN\n");
-       printf("  -a               edit all records (expression 'objectclass=*')\n");
-       printf("  -e editor        choose editor (or $VISUAL or $EDITOR)\n");
-       printf("  -v               verbose mode\n");
+       ldb_cmdline_help("ldbedit", stdout);
        exit(1);
 }
 
index 23a96a39761ab924684520233aab0ef1486a73a4..d0bca0479bdbc2700ec62e24cb764840702737ec 100644 (file)
@@ -39,12 +39,8 @@ static int failures;
 static void usage(void)
 {
        printf("Usage: ldbmodify <options> <ldif...>\n");
-       printf("Options:\n");
-       printf("  -H ldb_url       choose the database (or $LDB_URL)\n");
-       printf("  -o options       pass options like modules to activate\n");
-       printf("              e.g: -o modules:timestamps\n");
-       printf("\n");
        printf("Modifies a ldb based upon ldif change records\n\n");
+       ldb_cmdline_help("ldbmodify", stdout);
        exit(1);
 }
 
index 01ed3d98358248891a089f2caaa5e5ddb2fb9b9b..fcae766a2019700e4e9ab895199e4566f00486ce 100644 (file)
 static void usage(void)
 {
        printf("Usage: ldbrename [<options>] <olddn> <newdn>\n");
-       printf("Options:\n");
-       printf("  -H ldb_url       choose the database (or $LDB_URL)\n");
-       printf("  -o options       pass options like modules to activate\n");
-       printf("              e.g: -o modules:timestamps\n");
-       printf("\n");
        printf("Renames records in a ldb\n\n");
+       ldb_cmdline_help("ldbmodify", stdout);
        exit(1);
 }