summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-06-26 11:24:03 +0000
committerfukachan <fukachan>2004-06-26 11:24:03 +0000
commit632f7b7ab811338171c2c5ec6298912d2b4cb50d (patch)
treece65380db5b8f265bfbec9c4fb5c9b10ce99ce9d /fml/lib
parent95596687f56a9c1070ee2701b56613f07f5877bd (diff)
downloadfml8-632f7b7ab811338171c2c5ec6298912d2b4cb50d.tar.gz
fml8-632f7b7ab811338171c2c5ec6298912d2b4cb50d.tar.bz2
fml8-632f7b7ab811338171c2c5ec6298912d2b4cb50d.zip
overhaul:
fix comments. use //o if could. bug fix notice_cc_recipient handling.
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/Command.pm25
1 files changed, 13 insertions, 12 deletions
diff --git a/fml/lib/FML/Command.pm b/fml/lib/FML/Command.pm
index 2e93d65b..6a0ac4a6 100644
--- a/fml/lib/FML/Command.pm
+++ b/fml/lib/FML/Command.pm
@@ -4,11 +4,12 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Command.pm,v 1.45 2004/03/04 04:30:12 fukachan Exp $
+# $FML: Command.pm,v 1.46 2004/04/23 04:10:27 fukachan Exp $
#
# XXX
-# XXX FML::Command should be simple since all program uses this wrapper.
+# XXX FML::Command should be simple since many programs use this wrapper
+# XXX as the entrance into command modules.
# XXX So, complicated checks are moved to FML::Process::* and each module.
# XXX
@@ -23,7 +24,7 @@ my $debug = 0;
=head1 NAME
-FML::Command - fml command dispatcher
+FML::Command - fml command dispatcher.
=head1 SYNOPSIS
@@ -89,7 +90,7 @@ sub set_mode
my ($self, $curproc, $command_args, $mode) = @_;
# always 'user' if invalid mode specified.
- # XXX use capital letter for module name used latter.
+ # XXX use capital letter for module name used latter (module loading).
if ($mode =~ /admin/i) {
$command_args->{'command_mode'} = 'Admin';
}
@@ -108,8 +109,8 @@ sub get_mode
my ($self, $curproc, $command_args) = @_;
if (defined $command_args->{ command_mode }) {
- # XXX use capital letter for module name used latter.
- if ($command_args->{'command_mode'} =~ /admin/i) {
+ # XXX use capital letter for module name used latter (module loading).
+ if ($command_args->{'command_mode'} eq 'Admin') {
return 'Admin';
}
else {
@@ -194,7 +195,7 @@ sub notice_cc_recipient
eval qq{ use $pkg; \$command = new $pkg;};
unless ($@) {
if ($command->can('notice_cc_recipient')) {
- $command->notice_cc_recipient($curproc, $command_args);
+ return $command->notice_cc_recipient($curproc, $command_args);
}
}
@@ -245,14 +246,14 @@ sub simple_syntax_check
my $options = $command_args->{ options } || [];
# test pattern
- my @test = @$options;
+ my (@test) = @$options;
unshift(@test, $comsubname);
unshift(@test, $comname);
$self->safe_regexp_match($curproc, $command_args, \@test);
}
-# Descriptions: simple syntax of given array by FML::Restriction::Command.
+# Descriptions: simple syntax check by FML::Restriction::Command.
# Arguments: OBJ($self)
# OBJ($curproc) HASH_REF($command_args) ARRAY_REF($testlist)
# Side Effects: none
@@ -286,9 +287,9 @@ C<FML::Command::$MODE::$command>.
=cut
-# Descriptions: run FML::Command::XXX:YYY()
+# Descriptions: run FML::Command::MODE::COMMAND().
# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
-# Side Effects: load appropriate module
+# Side Effects: load appropriate module.
# Return Value: none
sub AUTOLOAD
{
@@ -297,7 +298,7 @@ sub AUTOLOAD
my $default_lock_channel = 'command_serialize';
# we need to ignore DESTROY()
- return if $AUTOLOAD =~ /DESTROY/;
+ return if $AUTOLOAD =~ /DESTROY/o;
# user mode by default
# XXX IMPORTANT: user mode if the given mode is invalid.