]> arthur.barton.de Git - netatalk.git/commitdiff
macusers, apple_dump and asip-status.pl: option "-v" show version.
authorHAT <hat@fa2.so-net.ne.jp>
Tue, 30 Aug 2011 14:23:11 +0000 (23:23 +0900)
committerHAT <hat@fa2.so-net.ne.jp>
Tue, 30 Aug 2011 14:23:11 +0000 (23:23 +0900)
contrib/macusers/macusers.in
contrib/shell_utils/apple_dump.in
contrib/shell_utils/asip-status.pl.in

index 75ddb5c4366e41eb78b2e0d432a9209ae5a06470..b37955512118e7164e9f379ba1d5260e1074dc23 100644 (file)
@@ -2,6 +2,7 @@
 
 use strict;
 use Socket;
+use File::Basename;
 use vars qw($MAC_PROCESS $PS_STR $MATCH_STR $ASIP_PORT_NO $ASIP_PORT $LSOF);
 
 # Written for linux; may have to be modified for your brand of Unix.
@@ -9,6 +10,15 @@ use vars qw($MAC_PROCESS $PS_STR $MATCH_STR $ASIP_PORT_NO $ASIP_PORT $LSOF);
 # Support Solaris added by Frank Lahm <franklahm@googlemail.com>.
 # Support has also been added for 16 character usernames.
 
+if ($ARGV[0] =~ /^(-v|-version|--version)$/ ) {
+        printf ("%s \(Netatalk @NETATALK_VERSION@\)\n", basename($0));
+        exit(1);
+} elsif ($ARGV[0] =~ /^(-h|-help|--help)$/ ) {
+        printf ("usage: %s \[-v|-version|--version|-h|-help|--help\]\n", basename($0));
+        printf ("Show users connecting via AFP\n");
+        exit(1);
+}
+
 $MAC_PROCESS = "afpd";
 if ($^O eq "freebsd" || $^O eq "openbsd") {
         $PS_STR    = "-awwxouser,pid,ppid,start,command";
index 33058cd0b7c68f812bfdbfedb5a14c7a39a05157..65eec7908e0b4ea2c61e5f52308a1c2b5f537a13 100755 (executable)
@@ -56,10 +56,11 @@ $finderinfo = 0;              #  0: unknown   1: file   2: directory
 while ($arg = shift @ARGV)
 {
     if  ($arg =~ /^(-h|-help|--help)$/ ) {
-        printf ("usage: %s [-a] FILE|DIR\n"     ,basename($0));
-        printf (" or:   %s -f FILE\n"           ,basename($0));
-        printf (" or:   %s -d FILE\n"           ,basename($0));
-        printf (" or:   %s -h|-help|--help\n"   ,basename($0));
+        printf ("usage: %s [-a] FILE|DIR\n"           ,basename($0));
+        printf (" or:   %s -f FILE\n"                 ,basename($0));
+        printf (" or:   %s -d FILE\n"                 ,basename($0));
+        printf (" or:   %s -h|-help|--help\n"         ,basename($0));
+        printf (" or:   %s -v|-version|--version\n"   ,basename($0));
         printf ("Dump AppleSingle/AppleDouble format file.\n");
         printf ("\n");
         printf ("  -a (default)     Dump a AppleSingle/AppleDouble file for FILE or DIR\n");
@@ -71,6 +72,7 @@ while ($arg = shift @ARGV)
         printf ("  -f               Dump FILE. Assume FinderInfo to be FileInfo.\n");
         printf ("  -d               Dump FILE. Assume FinderInfo to be DirInfo.\n");
         printf ("  -h,-help,--help  Display this help and exit\n");
+        printf ("  -v,-version,--version  Show version and exit\n");
         printf ("\n");
         printf ("There is no way to detect whether FinderInfo is FileInfo or DirInfo.\n");
         printf ("By default, %s examins whether file or directory,\n"   ,basename($0));
@@ -78,7 +80,10 @@ while ($arg = shift @ARGV)
         printf ("and so on.\n");
         printf ("If setting option -f or -d, %s assume FinderInfo and doesn't look for\n");
         printf ("another file.\n");
-        exit 0;
+        exit 1;
+    } elsif ($arg =~ /^(-v|-version|--version)$/ ) {
+        printf ("%s \(Netatalk @NETATALK_VERSION@\)\n", basename($0));
+        exit 1;
     } elsif ($arg eq "-a") {
         $finderinfo = 0;
     } elsif ($arg eq "-f") {
index ccd0332edd6c4ccf7094a71d2a1e08f8f743a9e4..4fa260947ca9c059fb354350d8cd22c2b71a5c8c 100755 (executable)
@@ -16,7 +16,7 @@
 #
 
 #
-# This edition is a part of netatalk.
+# This edition is a part of netatalk @NETATALK_VERSION@.
 #
 
 use strict;
@@ -32,12 +32,29 @@ while ($arg = shift @ARGV)
        $main::show_icon = 1 if ($arg eq "-i");
        $main::debug = 1 if ($arg eq "-d");
        $main::hexdump = 1 if ($arg eq "-x");
+       $main::showver = 1 if ($arg eq "-v");
+       $main::showver = 1 if ($arg eq "-version");
+       $main::showver = 1 if ($arg eq "--version");
        $hostport = $arg if ($arg !~ /^-/);
 }
 
+if ($main::showver ==1)
+{
+        print "$0\n";
+        print "Original edition: 7 May 1997 \(v1.0\) James W. Abendschan\n";
+        print "This edition is a part of Netatalk @NETATALK_VERSION@\n";
+        exit(-1);
+}
+
 if ($hostport eq "")
 {
-       print "usage: $0 hostname[:port] [-i show icon] [-d debug] [-x hex dump]\n";
+       print "usage: $0 [-d] [-i] [-x] hostname[:port]\n";
+       print "       $0 -v|-version|--version\n";
+       print "Queries AFP servers for their capabilities.\n";
+       print "  -d: Enable debug output.\n";
+       print "  -i: Show icon if it exists.\n";
+       print "  -x: Enable hex dump output.\n";
+       print "  -v,-version,--version: Show version.\n";
        exit(-1);
 }