issue update
[videosite.git] / videosite.pl
index 2b97918..bf14b95 100644 (file)
@@ -444,21 +444,40 @@ sub sig_complete {
     my @matches;
 
     if ($linestart !~ m|^/videosite\b|) {
-        write_irssi(undef, "No concern");
         return;
     }
 
     if ('/videosite' eq $linestart) {
         # No command enterd so far. Produce a list of possible follow-ups
-        @matches = sort grep {/^$word/} keys (%{$videosite_commands});
+        @matches = grep {/^$word/} keys (%{$videosite_commands});
     } elsif ('/videosite set' eq $linestart) {
         # 'set' command entered. Produce a list of modules
         foreach (@grabbers, @getters) {
             push(@matches, $_->{'NAME'}) if $_->{'NAME'} =~ m|^$word|;
         };
+    } elsif ($linestart =~ m|^/videosite set (\w+)$|) {
+        my $module = $1;
+
+        foreach my $p (@getters, @grabbers) {
+            if ($p->{'NAME'} eq $module) {
+                @matches = $p->getparamlist($word);
+                last;
+            }
+        }
+    } elsif ($linestart =~ m|/videosite set (\w+) (\w+)$|) {
+        my $module = $1;
+        my $param = $2;
+
+        foreach my $p (@getters, @grabbers) {
+            if ($p->{'NAME'} eq $module) {
+                @matches = $p->getparamvalues($param, $word);
+                last;
+            }
+        }
     }
 
-    push(@{$complist}, @matches);
+
+    push(@{$complist}, sort @matches);
     ${$want_space} = 0;
 
     Irssi::signal_stop();