neem . en .. niet meer mee in vi

This commit is contained in:
Ward Wouts 2001-08-30 08:04:22 +00:00
parent 0b3629c4f5
commit ff1d908255

View file

@ -48,7 +48,9 @@ sub read_cur_dir {
my (@dir, $filename); my (@dir, $filename);
opendir(DIRHANDLE, ".") or die "couldn't open .: $!"; opendir(DIRHANDLE, ".") or die "couldn't open .: $!";
while ( defined ($filename = readdir(DIRHANDLE)) ) { while ( defined ($filename = readdir(DIRHANDLE)) ) {
push @dir, "$filename\n"; unless ($filename eq "." | $filename eq "..") {
push @dir, "$filename\n";
}
} }
closedir(DIRHANDLE); closedir(DIRHANDLE);
@source = sort @dir; @source = sort @dir;
@ -81,7 +83,7 @@ sub read_temp {
my $target_name = shift; my $target_name = shift;
open TARGET, $target_name or die "Couldn't open tempfile: $target_name: $!"; open TARGET, $target_name or die "Couldn't open tempfile: $target_name: $!";
@target = <TARGET>; @target = <TARGET>;
close (TARGET); close TARGET;
} }
# Moves files from the names in one array to the names in another array # Moves files from the names in one array to the names in another array
@ -129,7 +131,8 @@ sub run_checks {
} }
foreach $line (@target) { foreach $line (@target) {
if ( $line =~ m/^$/ ) { die "Aborting. You can't move to empy names.\n"; } if ( $line =~ m/^$/ ) {
die "Aborting. You can't move to empy names.\n"; }
} }
if ( &check_unique(@target) ) { if ( &check_unique(@target) ) {
@ -221,11 +224,13 @@ It basically lets you edit the names in a directory with an editor
of your choice. By default this will be "vi", but it honors the EDITOR of your choice. By default this will be "vi", but it honors the EDITOR
environment variable. Which in turn can be overridden with the -e option. environment variable. Which in turn can be overridden with the -e option.
$0 [options]
At the moment it takes the following options: At the moment it takes the following options:
-h this help message -h this help message
-e "editor" invoke with this editor; ignored if -f or -p is given -e <editor> invoke with this editor; ignored if -f or -p is given
-p "pattern" use a pattern to edit; ignored if -f is given -p <pattern> use a pattern to edit; ignored if -f is given
-f "file" use a pattern file to edit -f <file> use a pattern file to edit
EOT EOT
exit; exit;