diff --git a/mvwrap/mvwrap b/mvwrap/mvwrap index ced75d6..7a16cc2 100755 --- a/mvwrap/mvwrap +++ b/mvwrap/mvwrap @@ -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 = ; - 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 invoke with this editor; ignored if -f or -p is given +-p use a pattern to edit; ignored if -f is given +-f use a pattern file to edit EOT exit;