Subject: | Use cross-platform basename |
The $self->{cmd} is constructed by s|.*/|| which is Unix-specifix. A
better solution is to use File::Basename which has been in core Perl
since 5.000. Below is a patch that implements that change.
-- Chris
diff -ur Getopt-Compact-0.02-orig/lib/Getopt/Compact.pm
Getopt-Compact-0.02/lib/Getopt/Compact.pm
--- Getopt-Compact-0.02-orig/lib/Getopt/Compact.pm 2004-09-24
01:19:00.000000000 -0500
+++ Getopt-Compact-0.02/lib/Getopt/Compact.pm 2006-03-21
15:12:57.000000000 -0600
@@ -278,7 +278,8 @@
$self->{usage} = 1 unless exists $self->{usage};
unless($self->{cmd}) {
$self->{cmd} = $0 || '';
- $self->{cmd} =~ s|^.*/||;
+ require File::Basename;
+ $self->{cmd} = File::Basename::basename($self->{cmd});
}
# add mode options