summaryrefslogtreecommitdiffstats
path: root/contrib/pacsearch.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pacsearch.in')
-rwxr-xr-xcontrib/pacsearch.in26
1 files changed, 18 insertions, 8 deletions
diff --git a/contrib/pacsearch.in b/contrib/pacsearch.in
index db9d6ad1..b1db8abe 100755
--- a/contrib/pacsearch.in
+++ b/contrib/pacsearch.in
@@ -24,22 +24,32 @@
use strict;
use warnings;
-my $progname = "pacsearch";
-my $version = "2.0";
+my $myname = 'pacsearch';
+my $myver = '@PACKAGE_VERSION@';
+
+sub usage {
+ print "$myname - Add color and install information to a pacman -Ss search\n";
+ print "Usage: $myname <pattern>\n";
+ print "Example: $myname ^gnome\n";
+}
+
+sub version {
+ printf "%s %s\n", $myname, $myver;
+ print "Copyright (C) 2008-2011 Dan McGee <dan\@archlinux.org>\n\n";
+ print "Based off original shell script version:\n";
+ print "Copyright (C) 2006-2007 Dan McGee <dan\@archlinux.org>\n";
+}
if ($#ARGV lt 0 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") {
- print "$progname - Add color and install information to a pacman -Ss search\n";
- print "Usage: $progname <pattern>\n";
- print "Example: $progname ^gnome\n";
+ usage;
if ($#ARGV lt 0) {
exit 1;
}
exit 0;
}
-if ($ARGV[0] eq "--version" || $ARGV[0] eq "-v") {
- print "$progname version $version\n";
- print "Copyright (C) 2006-2011 Dan McGee\n";
+if ($ARGV[0] eq "--version" || $ARGV[0] eq "-V") {
+ version;
exit 0;
}