You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdenetwork/ksirc/puke/convert_commands.pl

14 lines
297 B

#!/usr/bin/perl
open(CMD, "cat commands.h *-cmd.h|");
open(CMDP, ">commands-perl.pl");
while(<CMD>){
if(/#define (\S+) (.+)/){
print CMDP "\$${1} = $2;\n";
print CMDP "\$PUKE_NAME2NUM\{'$1'\} = $2;\n";
print CMDP "\$PUKE_NUM2NAME\{'$2'\} = '$1';\n";
}
}
print CMDP "\n1;\n";