- Add autocompletion for parameter names and values
[videosite.git] / videosite.pl
index 54a1280..bf14b95 100644 (file)
@@ -455,8 +455,28 @@ sub sig_complete {
         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}, sort @matches);
     ${$want_space} = 0;