mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-02 15:34:05 +01:00
Improve cdecl usage message
This commit is contained in:
parent
a6b66cb351
commit
6740522fae
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user