add debug commands to help text
[videosite.git] / videosite.pl
index 2e361b0..9be1fee 100644 (file)
@@ -79,7 +79,7 @@ sub check_for_link {
     }
 
     # Look if we should ignore this line
-    if ($message =~ m|/nosave|) {
+    if ($message =~ m,(?:\s|^)/nosave(?:\s|$),) {
         return;
     }
 
@@ -97,7 +97,7 @@ sub check_for_link {
 sub cmd_save {
 
     open(CONF, '>'.$conffile);
-    print CONF XML::Simple::XMLout($conf, KeepRoot => 1, KeyAttr => ['module', 'key']);
+    print CONF XML::Simple::XMLout($conf, KeepRoot => 1, KeyAttr => {'config' => 'module', 'option' => 'key'});
     close(CONF);
 }
 
@@ -154,7 +154,16 @@ sub cmd_help {
         }
         write_irssi(undef, 'No such module');
     } else {
-        write_irssi(undef, "Supported commands:\n save: Save the current configuration\n help [modulename]: Display this help, or module specific help\n show [modulename]: Show loaded modules, or the current parameters of a module\n set modulename parameter value: set a module parameter to a new value\n getter [modulename]: display or set the getter to use");
+        write_irssi(undef,
+                   "Supported commands:\n".
+                   " save: Save the current configuration\n".
+                   " help [modulename]: Display this help, or module specific help\n".
+                   " show [modulename]: Show loaded modules, or the current parameters of a module\n".
+                   " set modulename parameter value: set a module parameter to a new value\n".
+                   " getter [modulename]: display or set the getter to use\n".
+                   " debug: enable debugging messages\n".
+                   " nodebug: disable debugging messages"
+                   );
     }
 }
 
@@ -231,7 +240,7 @@ sub init_videosite {
 
     my $p;
 
-    unless(-r $conffile && defined($conf = XML::Simple::XMLin($conffile, ForceArray => ['config', 'option'], KeepRoot => 1, KeyAttr => ['module', 'key']))) {
+    unless(-r $conffile && defined($conf = XML::Simple::XMLin($conffile, ForceArray => ['config', 'option'], KeepRoot => 1, KeyAttr => {'config' => 'module', 'option' => 'key'}))) {
         # No config, start with an empty one
         write_debug(undef, 'No config found, using defaults');
         $conf = { 'videosite' => { 'getter' => '' }};