From 6740522fae63d8f20e70077fb68b06b7f6d6eae3 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 5 Jun 2014 21:45:25 +0000 Subject: [PATCH] Improve cdecl usage message --- PBot/VERSION.pm | 4 ++-- modules/cdecl.pl | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 1413725c..885835e5 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,8 +13,8 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 615, - BUILD_DATE => "2014-06-03", + BUILD_REVISION => 616, + BUILD_DATE => "2014-06-05", }; 1; diff --git a/modules/cdecl.pl b/modules/cdecl.pl index 5d03e075..7f2d6f90 100755 --- a/modules/cdecl.pl +++ b/modules/cdecl.pl @@ -2,17 +2,17 @@ # quick and dirty by :pragma +my $command = join(' ', @ARGV); -if ($#ARGV < 0) { - print "For help with cdecl, see http://linux.die.net/man/1/cdecl\n"; +my @args = split(' ', $command); # because @ARGV may be one quoted argument +if (@args < 2) { + print "Usage: cdecl , see http://linux.die.net/man/1/cdecl\n"; die; } -my $command = join(' ', @ARGV); - $command = quotemeta($command); $command =~ s/\\ / /g; -#print "[$command]\n"; + my $result = `/usr/bin/cdecl -c $command`; chomp $result;