gecko-dev/extensions/xmlterm/scripts/xrpchelp
svn%xmlterm.org 990f06577a --NOT PART OF DEFAULT BUILD--
XMLterm changes only.
Added a coupled of pagelet test scripts.
2000-10-10 04:40:22 +00:00

35 lines
1.2 KiB
Perl
Executable File

#!/usr/bin/perl
# Usage: xrpchelp <server-URL> [<method-name>]
use Frontier::Client;
die "Usage: xrpchelp <server-URL> [<method-name>]\n"
unless (@ARGV == 1) or (@ARGV == 2);
my $url = shift @ARGV; # XML-RPC server URL
$server = Frontier::Client->new( 'url' => $url, 'debug' => 0 );
my $cookie = $ENV{LTERM_COOKIE}; # Cookie for security
print "\e{S$cookie\012"; # Escape sequence for start of HTML
if (@ARGV) { # Print help string for method
print $server->call("system.methodHelp", @ARGV), "\n"; # Print method help
} else { # List all method names
my $list = $server->call("system.listMethods", @ARGV); # Get method names
print "<OL>\n"; # Ordered list start tag
foreach $method (@$list) { # For each method name, add list element
print qq%<LI><SPAN CLASS='textlink' onClick="return HandleEvent(event,
'click','sendln',-\#,'xrpchelp $url $method')">$method</SPAN>\n%;
}
print "</OL>\n"; # Ordered list end tag
}
print "\000"; # Escape sequence for end of HTML