Browse Source

Ticket 332 - Fix usage in scripts

Description:  Fixed some minor issues with the usage in some of the scripts.

https://fedorahosted.org/389/ticket/332

Reviewed by: richm & Noriko(Thanks!)
Mark Reynolds 12 years ago
parent
commit
129b3aa8e4

+ 2 - 2
ldap/admin/src/scripts/bak2db.pl.in

@@ -53,8 +53,8 @@ $dbtype = "ldbm database";
 $i = 0;
 
 sub usage {
-    print(STDERR "Usage: bak2db.pl [-v] [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } -a dirname [-t dbtype]\n");
-    print(STDERR "                 [-n backendname] [-P protocol] [-h]\n");
+    print(STDERR "Usage: bak2db.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } -a dirname [-t dbtype]\n");
+    print(STDERR "                 [-n backendname] [-P protocol] [-v] [-h]\n");
     print(STDERR "Options:\n");
     print(STDERR "        -D rootdn    - Directory Manager\n");
     print(STDERR "        -w password  - Directory Manager's password\n");

+ 1 - 1
ldap/admin/src/scripts/db2index.pl.in

@@ -54,7 +54,7 @@ $attr_count = 0;
 $vlv_count = 0;
 
 sub usage {
-    print(STDERR "Usage: db2index.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-n] [-P protocol]\n");
+    print(STDERR "Usage: db2index.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-P protocol]\n");
     print(STDERR "                   -n backendname [-t attributeName[:indextypes[:matchingrules]]] [-T vlvTag] [-v] [-h]\n");
     print(STDERR "Options:\n");
     print(STDERR "        -D rootdn       - Directory Manager\n");

+ 3 - 3
ldap/admin/src/scripts/db2ldif.pl.in

@@ -65,9 +65,9 @@ $excli = 0;
 $decrypt_on_export = 0;
 
 sub usage {
-    print(STDERR "Usage: db2index.pl [-v] [-Z serverID] [-D rootdn] { -w password | -w - | -j pwfilename }\n");
-    print(STDERR "                   [-P protocol]{-n backendname}* | {-s include}* [{-x exclude}*]\n");
-    print(STDERR "                   [-a filename] [-m] [-M] [-u] [-C] [-N] [-U] [-a filename] [-h]\n");
+    print(STDERR "Usage: db2ldif.pl [-v] [-Z serverID] [-D rootdn] { -w password | -w - | -j pwfilename }\n");
+    print(STDERR "                  [-P protocol] {-n backendname}* | {-s include}* [{-x exclude}*] [-h]\n");
+    print(STDERR "                  [-a filename] [-m] [-M] [-r] [-u] [-C] [-N] [-U] [-E] [-1] [-a filename]\n");
     print(STDERR "Options:\n");
     print(STDERR "        -D rootdn       - Directory Manager\n");
     print(STDERR "        -w password     - Directory Manager's password\n");

+ 6 - 2
ldap/admin/src/scripts/dbverify.in

@@ -25,7 +25,7 @@ usage()
     echo "        -h             - Display usage"
 }
 
-while getopts "Z:n:hVfd:n:D:" flag
+while getopts "Z:n:hVvfd:n:D:" flag
 do
     case $flag in
         h) usage
@@ -34,7 +34,8 @@ do
         n) args=$args" -n $OPTARG";;
         d) args=$args" -d $OPTARG";;
         V) args=$args" -V";;
-        v) args=$args" -v";;
+        v) args=$args" -v"
+           display_version="yes";;
         f) args=$args" -f";;
         D) args=$args" -D $OPTARG";;
         ?) usage
@@ -54,6 +55,9 @@ fi
 configdir="@instconfigdir@/slapd-$servid"
 
 @sbindir@/ns-slapd dbverify -D $configdir $args
+if [ $display_version == "yes" ]; then
+    exit 0
+fi
 if [ $? -eq 0 ]; then
     echo "DB verify: Passed"
     exit 0

+ 1 - 1
ldap/admin/src/scripts/dn2rdn.in

@@ -12,7 +12,7 @@ export SHLIB_PATH
       
 usage ()
 {
-    echo "Usage: db2rdn [-Z serverID] [-h] [-f] [-v] [-d debuglevel]"
+    echo "Usage: dn2rdn [-Z serverID] [-h] [-f] [-v] [-d debuglevel]"
     echo "Options:"
     echo "        -Z serverID    - Server instance identifier"
     echo "        -f             - Force upgrade"

+ 8 - 1
ldap/admin/src/scripts/ldif2db.in

@@ -14,7 +14,7 @@ export SHLIB_PATH
 usage()
 {
     echo "Usage: ldif2db [-Z serverID] -n backendname {-s includesuffix}* [{-x excludesuffix}*] {-i ldiffile}*"
-    echo "               [-O] [-E] [-q] [-h]"
+    echo "               [-c chunksize] [-g [string]] [-G namespace_id] [-O] [-E] [-q] [-v] [-h]"
     echo "Note: either \"-n backend\", \"-s includesuffix\", and \"-i ldiffile\" are required."
     echo "Options:"
     echo "        -Z serverID       - The server instance identifier"
@@ -22,9 +22,16 @@ usage()
     echo "        -s inclduesuffix  - Suffix to include"
     echo "        -x excludesuffix  - Suffix to exclude"
     echo "        -i ldiffile       - LDIF file name"
+    echo "        -c chunksize      - Number of entries to process before starting a new pass"
+    echo "        -g [string]       - String is \"none\" or \"deterministic\""
+    echo "                           \"none\" - unique id is not generated"
+    echo "                           \"deterministic\" - generate name based unique id (-G name)"
+    echo "                            By default - generate time based unique id"
+    echo "        -G name           - Namespace id for name based uniqueid (-g deterministic)"
     echo "        -O                - Do not index the attributes"
     echo "        -E                - Encrypt attributes"
     echo "        -q                - Quiet mode - suppresses output"
+    echo "        -v                - Verbose output"
     echo "        -h                - Display usage" 
 }
 

+ 3 - 3
ldap/admin/src/scripts/ldif2db.pl.in

@@ -60,8 +60,8 @@ $encrypt_on_import = 0;
 
 sub usage {
     print(STDERR "Usage: ldif2db.pl -n backend [-Z serverID] [-D rootdn] { -w password | -w - | -j filename }\n");
-    print(STDERR "                  [-P protocol] {-s include}* [{-x exclude}*] [-O] [-c] [-v] [-h] [-g [string]]\n");
-    print(STDERR "                  [-G namespace_id] {-i filename}*\n");
+    print(STDERR "                  [-P protocol] {-s include}* [{-x exclude}*] [-O] [-c chunksize] [-v] [-h]\n");
+    print(STDERR "                  [-E] [-g [string] [-G namespace_id]] {-i filename}*\n");
     print(STDERR "Note: either \"-n backend\", \"-s includesuffix\", and \"-i ldiffile\" are required.\n");
     print(STDERR "Options:\n");
     print(STDERR "        -D rootdn     - Directory Manager\n");
@@ -74,7 +74,7 @@ sub usage {
     print(STDERR "        -s include    - Included suffix\n");
     print(STDERR "        -x exclude    - Excluded suffix(es)\n");
     print(STDERR "        -O            - Only create core db, no attr indexes\n");
-    print(STDERR "        -c size       - Merge chunk size\n");
+    print(STDERR "        -c chunksize  - Number of entries to process before starting a new pass\n");
     print(STDERR "        -g [string]   - String is \"none\" or \"deterministic\"\n");
     print(STDERR "                        \"none\" - unique id is not generated\n");
     print(STDERR "                        \"deterministic\" - generate name based unique id (-G name)\n");

+ 2 - 2
ldap/admin/src/scripts/ns-accountstatus.pl.in

@@ -56,8 +56,8 @@ $role = 0;
 
 sub usage
 {
-    print (STDERR "$cmd [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } \n");
-    print (STDERR "     [-p port] [-h host] [-P protocol] -I DN-to-$operation\n\n");
+    print (STDERR "ns-accountstatus.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } \n");
+    print (STDERR "                    [-p port] [-h host] [-P protocol] -I DN-to-$operation\n\n");
     print (STDERR "May be used to $operation a user or a domain of users\n\n");
     print (STDERR "Arguments:\n");
     print (STDERR "        -?                   - Display usage\n");

+ 2 - 2
ldap/admin/src/scripts/ns-activate.pl.in

@@ -56,8 +56,8 @@ $role = 0;
 
 sub usage
 {
-    print (STDERR "$cmd [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } \n");
-    print (STDERR "     [-p port] [-h host] [-P protocol] -I DN-to-$operation\n\n");
+    print (STDERR "ns-activate.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } \n");
+    print (STDERR "               [-p port] [-h host] [-P protocol] -I DN-to-$operation\n\n");
     print (STDERR "May be used to $operation a user or a domain of users\n\n");
     print (STDERR "Arguments:\n");
     print (STDERR "        -?                   - Display usage\n");

+ 1 - 1
ldap/admin/src/scripts/upgradednformat.in

@@ -21,7 +21,7 @@ export SHLIB_PATH
 
 usage ()
 {
-    echo "Usage: $0 -n backendname -a database_directory [-Z serverID] [-N] [-h]"
+    echo "Usage: upgradednformat -n backendname -a database_directory [-Z serverID] [-N] [-h]"
     echo "Options:"
     echo "        -n backendname         - Backend name"
     echo "        -a database_directory  - Path to database directory"

+ 1 - 1
ldap/admin/src/scripts/verify-db.pl.in

@@ -50,7 +50,7 @@ my $i = 0;
 
 sub usage
 {
-  print "Usage: $0 [-Z serverID] [ -a <fullpath_to_db_dir> ] [-h]\n";
+  print "Usage: verify-db.pl [-Z serverID] [ -a <fullpath_to_db_dir> ] [-h]\n";
 }
 
 # getDbDir checks up to 4 levels of db dirs