summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process/DocViewer.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-11-25 03:55:38 +0000
committerfukachan <fukachan>2001-11-25 03:55:38 +0000
commit76e67f09b21f76f5ba74f1b494927c0c998cddfc (patch)
treee6f5b333ed2c5a4e2b417018b66416fac281bc00 /fml/lib/FML/Process/DocViewer.pm
parent153c954f0c77127bd9f625f277e3bfa1eb391825 (diff)
downloadfml8-76e67f09b21f76f5ba74f1b494927c0c998cddfc.tar.gz
fml8-76e67f09b21f76f5ba74f1b494927c0c998cddfc.tar.bz2
fml8-76e67f09b21f76f5ba74f1b494927c0c998cddfc.zip
verify_request() checks @ARGV and show help() if needed
Diffstat (limited to 'fml/lib/FML/Process/DocViewer.pm')
-rw-r--r--fml/lib/FML/Process/DocViewer.pm33
1 files changed, 21 insertions, 12 deletions
diff --git a/fml/lib/FML/Process/DocViewer.pm b/fml/lib/FML/Process/DocViewer.pm
index 1a517d87..47c0d8df 100644
--- a/fml/lib/FML/Process/DocViewer.pm
+++ b/fml/lib/FML/Process/DocViewer.pm
@@ -4,7 +4,7 @@
# Copyright (C) 2000,2001 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: DocViewer.pm,v 1.4 2001/11/04 03:44:46 fukachan Exp $
+# $FML: DocViewer.pm,v 1.5 2001/11/25 03:13:50 fukachan Exp $
#
package FML::Process::DocViewer;
@@ -75,6 +75,22 @@ sub new
sub prepare { ; }
+# Descriptions: check @ARGV
+# Arguments: $self $args
+# Side Effects: longjmp() to help() if appropriate
+# Return Value: none
+sub verify_request
+{
+ my ($curproc, $args) = @_;
+ my $argv = $curproc->command_line_argv();
+
+ if (length(@$argv) == 1) {
+ $curproc->help();
+ exit(0);
+ }
+}
+
+
=head2 C<run($args)>
the main top level dispatcher.
@@ -94,12 +110,7 @@ sub run
my $myname = $curproc->myname();
my $argv = $curproc->command_line_argv();
- if ($myname eq 'fmldoc') {
- $curproc->_fmldoc($args);
- }
- else {
- my $command = $argv->[ 0 ] || croak("command not specified\n");
- }
+ $curproc->_fmldoc($args);
}
@@ -122,12 +133,10 @@ sub help
print <<"_EOF_";
-Usage: $name \$command \$ml_name [options]
-
-$name help \$ml_name show this help
+Usage: $name MODULE
-$name subscribe \$ml_name ADDRESS
-$name unsubscribe \$ml_name ADDRESS
+ For example,
+ $name FML::Process::Kernel
_EOF_
}