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.
# 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";
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");
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));
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") {
#
#
-# This edition is a part of netatalk.
+# This edition is a part of netatalk @NETATALK_VERSION@.
#
use strict;
$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);
}