summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-03-30 10:18:33 +0000
committerfukachan <fukachan>2002-03-30 10:18:33 +0000
commitdf7899c7e36c575cd5044b5c8b86388101c7fa4b (patch)
treeb031b874e08af872b7a35c840db3551a427f8f63
parentaf8c2960b0b908ecf84dcb91e11c04f719e687aa (diff)
downloadfml8-df7899c7e36c575cd5044b5c8b86388101c7fa4b.tar.gz
fml8-df7899c7e36c575cd5044b5c8b86388101c7fa4b.tar.bz2
fml8-df7899c7e36c575cd5044b5c8b86388101c7fa4b.zip
admin {delete,unlink} -> admin file $subcommand
-rw-r--r--fml/lib/FML/Command/Admin/file.pm (renamed from fml/lib/FML/Command/Admin/delete.pm)44
-rw-r--r--fml/lib/FML/Command/Admin/unlink.pm61
2 files changed, 30 insertions, 75 deletions
diff --git a/fml/lib/FML/Command/Admin/delete.pm b/fml/lib/FML/Command/Admin/file.pm
index d9f88147..f4841d7b 100644
--- a/fml/lib/FML/Command/Admin/delete.pm
+++ b/fml/lib/FML/Command/Admin/file.pm
@@ -4,10 +4,10 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: delete.pm,v 1.1 2002/03/24 11:26:46 fukachan Exp $
+# $FML: file.pm,v 1.1 2002/03/26 04:01:36 fukachan Exp $
#
-package FML::Command::Admin::delete;
+package FML::Command::Admin::file;
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
use Carp;
@@ -15,7 +15,7 @@ use Carp;
=head1 NAME
-FML::Command::Admin::delete - delete file operations
+FML::Command::Admin::file - file file operations
=head1 SYNOPSIS
@@ -23,7 +23,7 @@ See C<FML::Command> for more details.
=head1 DESCRIPTION
-delete a new address.
+file a new address.
=head1 METHODS
@@ -49,10 +49,17 @@ sub new
# Arguments: none
# Side Effects: none
# Return Value: NUM( 1 or 0)
-sub need_lock { 0;}
+sub need_lock { 1;}
-# Descriptions: delete a new user
+# Descriptions: this command needs "command subcommand parameters" style or not
+# Arguments: none
+# Side Effects: none
+# Return Value: NUM( 1 or 0)
+sub is_subcommand_style { 1;}
+
+
+# Descriptions: file a new user
# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
# Side Effects: update $member_map $recipient_map
# Return Value: none
@@ -66,16 +73,25 @@ sub process
my @argv = ();
# analyze ...
- for my $x (@$options) {
- if ($x =~ /^([A-Za-z0-9]+)$/) {
- push(@argv, $x);
+ my ($subcommand, @args)= @$options;
+
+ if ($subcommand eq 'remove' ||
+ $subcommand eq 'delete' ||
+ $subcommand eq 'unlink') {
+ for my $x (@args) {
+ if ($x =~ /^([A-Za-z0-9]+)$/) {
+ push(@argv, $x);
+ }
}
- }
- $du_args->{ options } = \@argv;
+ $du_args->{ options } = \@argv;
- use FML::Command::FileUtils;
- my $obj = new FML::Command::FileUtils;
- $obj->delete($curproc, $command_args, $du_args);
+ use FML::Command::FileUtils;
+ my $obj = new FML::Command::FileUtils;
+ $obj->remove($curproc, $command_args, $du_args);
+ }
+ else {
+ croak("unknown subcommand");
+ }
}
diff --git a/fml/lib/FML/Command/Admin/unlink.pm b/fml/lib/FML/Command/Admin/unlink.pm
deleted file mode 100644
index dac793e2..00000000
--- a/fml/lib/FML/Command/Admin/unlink.pm
+++ /dev/null
@@ -1,61 +0,0 @@
-#-*- perl -*-
-#
-# Copyright (C) 2002 Ken'ichi Fukamachi
-# All rights reserved. This program is free software; you can
-# redistribute it and/or modify it under the same terms as Perl itself.
-#
-# $FML: ls.pm,v 1.1 2002/03/24 11:26:46 fukachan Exp $
-#
-
-package FML::Command::Admin::ls;
-use strict;
-use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
-use Carp;
-
-
-use FML::Command::Admin::delete;
-@ISA = qw(FML::Command::Admin::delete);
-
-
-# Descriptions: delete files
-# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
-# Side Effects: forward request to delete module
-# Return Value: none
-sub process
-{
- my ($self, $curproc, $command_args) = @_;
- $self->SUPER::process($curproc, $command_args);
-}
-
-=head1 NAME
-
-FML::Command::Admin::unlink - remove file
-
-=head1 SYNOPSIS
-
-See C<FML::Command> for more details.
-
-=head1 DESCRIPTION
-
-same as C<delete>.
-
-=head1 AUTHOR
-
-Ken'ichi Fukamachi
-
-=head1 COPYRIGHT
-
-Copyright (C) 2002 Ken'ichi Fukamachi
-
-All rights reserved. This program is free software; you can
-redistribute it and/or modify it under the same terms as Perl itself.
-
-=head1 HISTORY
-
-FML::Command::Admin::ls appeared in fml5 mailing list driver package.
-See C<http://www.fml.org/> for more details.
-
-=cut
-
-
-1;