]> arthur.barton.de Git - netatalk.git/commitdiff
cnid_metad, cnid_dbd, dbd: show version
authorHAT <hat@fa2.so-net.ne.jp>
Sun, 1 Jan 2012 14:33:53 +0000 (23:33 +0900)
committerHAT <hat@fa2.so-net.ne.jp>
Sun, 1 Jan 2012 14:33:53 +0000 (23:33 +0900)
etc/cnid_dbd/cmd_dbd.c
etc/cnid_dbd/cnid_metad.c
etc/cnid_dbd/main.c

index e07741564136026d719db8505bb04df8f3101c0c..440f40b16d43dcfd029a60ce174abf2af0e35eb1 100644 (file)
@@ -170,7 +170,8 @@ static void set_signal(void)
 
 static void usage (void)
 {
-    printf("Usage: dbd [-e|-t|-v|-x] -d [-i] | -s [-c|-n]| -r [-c|-f] | -u <path to netatalk volume>\n"
+    printf("dbd (Netatalk %s)\n"
+           "Usage: dbd [-e|-t|-v|-x] -d [-i] | -s [-c|-n]| -r [-c|-f] | -u <path to netatalk volume>\n"
            "dbd can dump, scan, reindex and rebuild Netatalk dbd CNID databases.\n"
            "dbd must be run with appropiate permissions i.e. as root.\n\n"
            "Main commands are:\n"
@@ -186,7 +187,7 @@ static void usage (void)
            "      7. Check for orphaned CNIDs in database (requires -e)\n"
            "      8. Open and close adouble files\n"
            "      Options: -c Don't check .AppleDouble stuff, only ckeck orphaned.\n"
-           "               -n Don't open CNID database, skip CNID checks\n\n"
+           "               -n Don't open CNID database, skip CNID checks.\n\n"
            "   -r Rebuild volume:\n"
            "      1. Sync CNIDSs in database with volume\n"
            "      2. Make sure .AppleDouble dir exist, create if missing\n"
@@ -197,18 +198,21 @@ static void usage (void)
            "      7. Check for orphaned CNIDs in database (requires -e)\n"
            "      8. Open and close adouble files\n"
            "      Options: -c Don't create .AppleDouble stuff, only cleanup orphaned.\n"
-           "               -f wipe database and rebuild from IDs stored in AppleDouble files,\n"
-           "                  only available for volumes without 'nocnidcache' option. Implies -e.\n\n"
+           "               -f wipe database and rebuild from IDs stored in AppleDouble\n"
+           "                  files, only available for volumes without 'nocnidcache'\n"
+           "                  option. Implies -e.\n\n"
            "   -u Upgrade:\n"
-           "      Opens the database which triggers any necessary upgrades, then closes and exits.\n\n"
+           "      Opens the database which triggers any necessary upgrades,\n"
+           "      then closes and exits.\n\n"
            "General options:\n"
            "   -e only work on inactive volumes and lock them (exclusive)\n"
            "   -x rebuild indexes (just for completeness, mostly useless!)\n"
            "   -t show statistics while running\n"
            "   -v verbose\n\n"
            "WARNING:\n"
-           "For -r -f restore of the CNID database from the adouble files, the CNID must of course\n"
-           "be synched to them files first with a plain -r rebuild !\n"
+           "For -r -f restore of the CNID database from the adouble files,\n"
+           "the CNID must of course be synched to them files first with a plain -r rebuild!\n"
+           , VERSION
         );
 }
 
index 5b2f76760825e3700aa039d81f1ee17418c0d488..aec73ecac842f11657aa1b3582f7d15473b6f3d2 100644 (file)
@@ -450,8 +450,12 @@ int main(int argc, char *argv[])
 
     set_processname("cnid_metad");
 
-    while (( cc = getopt( argc, argv, "ds:p:h:u:g:l:f:")) != -1 ) {
+    while (( cc = getopt( argc, argv, "vVds:p:h:u:g:l:f:")) != -1 ) {
         switch (cc) {
+        case 'v':
+        case 'V':
+            printf("cnid_metad (Netatalk %s)\n", VERSION);
+            return -1;
         case 'd':
             debug = 1;
             break;
index e2f8e98e8fca82e400e39a0cb3ceb61af54df628..e050a0e5137c4c1010f98ffc30865edffd4d384a 100644 (file)
@@ -288,8 +288,12 @@ int main(int argc, char *argv[])
 
     set_processname("cnid_dbd");
 
-    while (( ret = getopt( argc, argv, "d")) != -1 ) {
+    while (( ret = getopt( argc, argv, "vVd")) != -1 ) {
         switch (ret) {
+        case 'v':
+        case 'V':
+            printf("cnid_dbd (Netatalk %s)\n", VERSION);
+            return -1;
         case 'd':
             delete_bdb = 1;
             break;