more fancy menu script example
authorHarvie <tomas@mudrunka.cz>
Tue, 24 Aug 2010 02:43:02 +0000 (04:43 +0200)
committerHarvie <tomas@mudrunka.cz>
Tue, 24 Aug 2010 02:43:02 +0000 (04:43 +0200)
purple/answerscripts.d/10-menu.pl

index d7afa4e14020d4d71d199095f45b09b3acc985ae..40f22b4b2bd57e74daac0c22451bd5d7a75ae750 100755 (executable)
@@ -5,12 +5,13 @@ use warnings;
 use Switch;
 
 switch ($ENV{ANSW_MSG}) {
 use Switch;
 
 switch ($ENV{ANSW_MSG}) {
-       case /^!help$/  { print "What did you expected? A help?! :-P"; }
+       case /^!help$/  { print qx{ grep -o 'case /[^\$/]*' "$0" | grep -o '!.*' | tr '\n' ',' }; }
        case /^!ping$/  { print "PONG"; }
        case /^!whoami$/        { print "You are: $ENV{ANSW_FROM}"; }
        case /^!ping$/  { print "PONG"; }
        case /^!whoami$/        { print "You are: $ENV{ANSW_FROM}"; }
+       case /^!status$/        { print "[$ENV{ANSW_STATUS}] $ENV{ANSW_STATUS_MSG}"; }
        case /^!(reboot|reset|restart|halt)$/   { print "Broadcast message: The system is going down for reboot NOW !!"; }
        case /^!google/ { print "UTFG Yourself: http://google.com/"; }
        case /^!uptime$/        { print qx{uptime}; }
        case /^!date$/  { print qx{date}; }
        case /^!(reboot|reset|restart|halt)$/   { print "Broadcast message: The system is going down for reboot NOW !!"; }
        case /^!google/ { print "UTFG Yourself: http://google.com/"; }
        case /^!uptime$/        { print qx{uptime}; }
        case /^!date$/  { print qx{date}; }
-       case /^!dmesg$/ { print qx{ dmesg | tail -n 5 | tr '\n' '^' } }
+       case /^!dmesg$/ { print qx{ dmesg | tail -n 5 | tr '\n' '\t' } }
 }
 }
This page took 0.143519 seconds and 4 git commands to generate.