+ Irssi::command_bind('videosite' => \&cmdhandler);
+ }
+
+ write_irssi(undef, 'videosite initialized');
+}
+
+sub sig_complete {
+ my ($complist, $window, $word, $linestart, $want_space) = @_;
+ my @matches;
+
+ if ($linestart !~ m|^/videosite\b|) {
+ return;
+ }
+
+ if ('/videosite' eq $linestart) {
+ # No command enterd so far. Produce a list of possible follow-ups
+ @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|;
+ };
+ }
+
+ push(@{$complist}, sort @matches);
+ ${$want_space} = 0;
+
+ Irssi::signal_stop();