Improve cdecl usage message

This commit is contained in:
Pragmatic Software 2014-06-05 21:45:25 +00:00
parent a6b66cb351
commit 6740522fae
2 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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 <explain|declare|cast|set|...> <code>, 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;