r159: nicer usage messages when no URL is given
authorAndrew Tridgell <tridge@samba.org>
Sun, 11 Apr 2004 01:27:33 +0000 (01:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:51:12 +0000 (12:51 -0500)
source/lib/ldb/tools/ldbadd.c
source/lib/ldb/tools/ldbdel.c
source/lib/ldb/tools/ldbedit.c
source/lib/ldb/tools/ldbmodify.c
source/lib/ldb/tools/ldbsearch.c

index 446c0d80f9b247e22351853ac62e3f0ac9a6ae95..15febb76e787db9401dda6bb9807def0bb6ada7c 100644 (file)
@@ -101,8 +101,8 @@ static int process_file(struct ldb_context *ldb, FILE *f)
        }
 
        if (!ldb_url) {
-               fprintf(stderr, "You must specify a ldb URL\n");
-               exit(1);
+               fprintf(stderr, "You must specify a ldb URL\n\n");
+               usage();
        }
 
        argc -= optind;
index 0e50a68532e161c8ed904d20d917726fd3646dbb..48ee07ad256e125846516b88b71bee8f23948501 100644 (file)
@@ -67,8 +67,8 @@ static void usage(void)
        }
 
        if (!ldb_url) {
-               fprintf(stderr, "You must specify a ldb URL\n");
-               exit(1);
+               fprintf(stderr, "You must specify a ldb URL\n\n");
+               usage();
        }
 
        argc -= optind;
index c5eb1349dd7a5dbafb910777d6eba4cc2c29a397..13516e59cf5715b623c35b87a6364659129e5fe9 100644 (file)
@@ -281,7 +281,7 @@ static void usage(void)
                editor = "vi";
        }
 
-       while ((opt = getopt(argc, argv, "ab:e:H:s:")) != EOF) {
+       while ((opt = getopt(argc, argv, "hab:e:H:s:")) != EOF) {
                switch (opt) {
                case 'b':
                        basedn = optarg;
@@ -317,8 +317,8 @@ static void usage(void)
        }
 
        if (!ldb_url) {
-               fprintf(stderr, "You must specify a ldb URL\n");
-               exit(1);
+               fprintf(stderr, "You must specify a ldb URL\n\n");
+               usage();
        }
 
        argc -= optind;
index a93c710a7a6040c9281b0ff9ebad356386baa136..ac32f90c3bc2bfde01d5e3db60fadba2a12da762 100644 (file)
@@ -103,8 +103,8 @@ static int process_file(struct ldb_context *ldb, FILE *f)
        }
 
        if (!ldb_url) {
-               fprintf(stderr, "You must specify a ldb URL\n");
-               exit(1);
+               fprintf(stderr, "You must specify a ldb URL\n\n");
+               usage();
        }
 
        argc -= optind;
index 327feb28efa71db734677bb4a05ef62f94a3faba..45412f6104bd2322250a59144ed669f23eb4303c 100644 (file)
@@ -86,8 +86,8 @@ static void usage(void)
        }
 
        if (!ldb_url) {
-               fprintf(stderr, "You must specify a ldb URL\n");
-               exit(1);
+               fprintf(stderr, "You must specify a ldb URL\n\n");
+               usage();
        }
 
        argc -= optind;