diff options
| author | fukachan <fukachan> | 2002-04-07 05:08:23 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-04-07 05:08:23 +0000 |
| commit | 6b776b35261d7eddf0ece5ed379617c30d52612c (patch) | |
| tree | 54879c7b0c655153d30a52dbb5b0457d92fe2cde | |
| parent | 42e1aceb00f0106b8aa7598f56eaee366d157ca5 (diff) | |
| download | fml8-6b776b35261d7eddf0ece5ed379617c30d52612c.tar.gz fml8-6b776b35261d7eddf0ece5ed379617c30d52612c.tar.bz2 fml8-6b776b35261d7eddf0ece5ed379617c30d52612c.zip | |
clean up
| -rw-r--r-- | fml/lib/FML/Command.pm | 54 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/mget.pm | 10 | ||||
| -rw-r--r-- | fml/lib/FML/Process/ConfViewer.pm | 11 |
3 files changed, 45 insertions, 30 deletions
diff --git a/fml/lib/FML/Command.pm b/fml/lib/FML/Command.pm index 596f6803..9758e2e6 100644 --- a/fml/lib/FML/Command.pm +++ b/fml/lib/FML/Command.pm @@ -4,7 +4,7 @@ # 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.22 2002/02/20 13:59:48 fukachan Exp $ +# $FML: Command.pm,v 1.23 2002/03/23 12:20:25 fukachan Exp $ # package FML::Command; @@ -16,10 +16,14 @@ use FML::Log qw(Log LogWarn LogError); =head1 NAME -FML::Command - dispacher of fml commands +FML::Command - fml commands dispacher =head1 SYNOPSIS + use FML::Command; + my $obj = new FML::Command; + $obj->rewrite_prompt($curproc, $command_args, \$orig_command); + =head1 DESCRIPTION C<FML::Command> is a wrapper and dispathcer for fml commands. @@ -33,12 +37,6 @@ Also, C<FML::Command::Admin::somoting> for the admin command request. ordinary constructor. -=head2 C<AUTOLOAD()> - -dispatcher. -It hooks up the C<command> request and loads the module -C<FML::Command::command>. - =cut @@ -55,7 +53,22 @@ sub new } -# Descriptions: rewrite buffer +# Descriptions: ordinary destructor +# Arguments: none +# Side Effects: none +# Return Value: none +sub DESTROY { ;} + + +=head2 C<rewrite_prompt($curproc, $command_args, $rbuf)> + +rewrite the specified buffer $rbuf (STR_REF). +$rbuf is rewritten as a result. + +=cut + + +# Descriptions: rewrite prompt buffer # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) STR_REF($rbuf) # Side Effects: none # Return Value: none @@ -76,11 +89,13 @@ sub rewrite_prompt } -# Descriptions: ordinary destructor -# Arguments: none -# Side Effects: none -# Return Value: none -sub DESTROY { ;} +=head2 C<AUTOLOAD()> + +the command dispatcher. +It hooks up the C<command> request and loads the module +C<FML::Command::command>. + +=cut # Descriptions: run FML::Command::XXX:YYY() @@ -90,12 +105,15 @@ sub DESTROY { ;} sub AUTOLOAD { my ($self, $curproc, $command_args) = @_; - my $mode = 'User'; + # we need to ignore DESTROY() return if $AUTOLOAD =~ /DESTROY/; - if (defined $command_args->{ 'command_mode' }) { - $mode = $command_args->{'command_mode'} =~ /admin/i ? 'Admin' : 'User'; + # mode + my $mode = 'User'; + if (defined $command_args->{ command_mode }) { + $mode = + $command_args->{ command_mode } =~ /admin/i ? 'Admin' : 'User'; } my $comname = $AUTOLOAD; @@ -109,6 +127,7 @@ sub AUTOLOAD unless ($@) { my $need_lock = 1; # default. + # we need to authenticate this ? if ($command->can('auth')) { $command->auth($curproc, $command_args); } @@ -123,6 +142,7 @@ sub AUTOLOAD } } + # run the actual process if ($command->can('process')) { $curproc->lock() if $need_lock; $command->process($curproc, $command_args); diff --git a/fml/lib/FML/Command/Admin/mget.pm b/fml/lib/FML/Command/Admin/mget.pm index f97d35f0..b309e984 100644 --- a/fml/lib/FML/Command/Admin/mget.pm +++ b/fml/lib/FML/Command/Admin/mget.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: mget.pm,v 1.4 2001/12/22 09:53:09 fukachan Exp $ +# $FML: mget.pm,v 1.5 2002/02/18 14:24:12 fukachan Exp $ # package FML::Command::Admin::mget; @@ -12,13 +12,11 @@ use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; - - use FML::Command::Admin::get; @ISA = qw(FML::Command::Admin::get); -# Descriptions: get articles, files, et. al. +# Descriptions: get file(s) in $ml_home_dir # Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) # Side Effects: forwarded to get module # Return Value: none @@ -31,7 +29,7 @@ sub process =head1 NAME -FML::Command::Admin::mget - what is this +FML::Command::Admin::mget - get file(s) in $ml_home_dir =head1 SYNOPSIS @@ -39,7 +37,7 @@ See C<FML::Command> for more details. =head1 DESCRIPTION -forwarded to C<FML::Command::Admin::get>. +an alias of C<FML::Command::Admin::get>. =head1 AUTHOR diff --git a/fml/lib/FML/Process/ConfViewer.pm b/fml/lib/FML/Process/ConfViewer.pm index b4c0c9ba..f853eb7a 100644 --- a/fml/lib/FML/Process/ConfViewer.pm +++ b/fml/lib/FML/Process/ConfViewer.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi # All rights reserved. # -# $FML: ConfViewer.pm,v 1.9 2002/02/17 13:45:10 fukachan Exp $ +# $FML: ConfViewer.pm,v 1.10 2002/03/17 06:24:31 fukachan Exp $ # package FML::Process::ConfViewer; @@ -34,7 +34,7 @@ FML::Process::ConfViewer provides the main function for C<fmlconf>. =head2 C<new($args)> -constructor. +ordinary constructor. It make a C<FML::Process::Kernel> object and return it. =head2 C<prepare($args)> @@ -44,7 +44,7 @@ dummy. =cut -# Descriptions: constructor +# Descriptions: ordinary constructor # Arguments: OBJ($self) HASH_REF($args) # Side Effects: none # Return Value: FML::Process::ConfViewer object @@ -114,10 +114,7 @@ sub verify_request the top level dispatcher for C<fmlconf> and C<makefml>. -It kicks off internal function -C<_fmlconf($args)> for C<fmlconf> - and -C<_makefml($args)> for makefml. +It kicks off internal function C<_fmlconf($args)> for C<fmlconf>. NOTE: C<$args> is passed from parrent libexec/loader. |
