neem . en .. niet meer mee in vi
This commit is contained in:
parent
0b3629c4f5
commit
ff1d908255
1 changed files with 11 additions and 6 deletions
|
|
@ -48,7 +48,9 @@ sub read_cur_dir {
|
|||
my (@dir, $filename);
|
||||
opendir(DIRHANDLE, ".") or die "couldn't open .: $!";
|
||||
while ( defined ($filename = readdir(DIRHANDLE)) ) {
|
||||
push @dir, "$filename\n";
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue