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,8 +48,10 @@ sub read_cur_dir {
my (@dir, $filename);
opendir(DIRHANDLE, ".") or die "couldn't open .: $!";
while ( defined ($filename = readdir(DIRHANDLE)) ) {
unless ($filename eq "." | $filename eq "..") {
push @dir, "$filename\n";
}
}
closedir(DIRHANDLE);
@source = sort @dir;
}
@ -81,7 +83,7 @@ sub read_temp {
my $target_name = shift;
open TARGET, $target_name or die "Couldn't open tempfile: $target_name: $!";
@target = <TARGET>;
close (TARGET);
close TARGET;
}
# Moves files from the names in one array to the names in another array
@ -129,7 +131,8 @@ sub run_checks {
}
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) ) {
@ -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
environment variable. Which in turn can be overridden with the -e option.
$0 [options]
At the moment it takes the following options:
-h this help message
-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
-f "file" use a pattern file to edit
-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
-f <file> use a pattern file to edit
EOT
exit;