diff options
| author | fukachan <fukachan> | 2002-03-23 12:20:25 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-03-23 12:20:25 +0000 |
| commit | bb85781643278186368d692c1136826cd71870cc (patch) | |
| tree | 3e92cbcbec690359167f00b75040761d1fac5d5e | |
| parent | 246a7dc58db024d6e295667e3f531aa2c237080a (diff) | |
| download | fml8-bb85781643278186368d692c1136826cd71870cc.tar.gz fml8-bb85781643278186368d692c1136826cd71870cc.tar.bz2 fml8-bb85781643278186368d692c1136826cd71870cc.zip | |
implement rewrite_prompt(). It is used to hide password et. al.
| -rw-r--r-- | fml/lib/FML/Command.pm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/fml/lib/FML/Command.pm b/fml/lib/FML/Command.pm index e770f7e0..596f6803 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.21 2002/02/19 13:32:43 fukachan Exp $ +# $FML: Command.pm,v 1.22 2002/02/20 13:59:48 fukachan Exp $ # package FML::Command; @@ -55,6 +55,27 @@ sub new } +# Descriptions: rewrite buffer +# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) STR_REF($rbuf) +# Side Effects: none +# Return Value: none +sub rewrite_prompt +{ + my ($self, $curproc, $command_args, $rbuf) = @_; + my $command = undef; + my $comname = $command_args->{ comname }; + my $mode = $command_args->{'command_mode'} =~ /admin/i ? 'Admin' : 'User'; + my $pkg = "FML::Command::${mode}::${comname}"; + + eval qq{ use $pkg; \$command = new $pkg;}; + unless ($@) { + if ($command->can('rewrite_prompt')) { + $command->rewrite_prompt($curproc, $command_args, $rbuf); + } + } +} + + # Descriptions: ordinary destructor # Arguments: none # Side Effects: none |
