moreutils (0.15) UNRELEASED; urgency=low
* Remove notes about potential tools from README, moved to wiki.
-
- -- Joey Hess <joeyh@debian.org> Thu, 13 Jul 2006 12:21:38 -0400
+ * vidir: Don't abort if it sees an empty or all-whitespace line.
+ * vidir: If just a filename is removed and the number is left,
+ treat this the same as removing the whole line, and delete the file,
+ instead of trying to rename the file to "".
+ * vidir: Remove the periods after the item numbers.
+ * vidir: Man page improvements. Closes: #378122
+
+ -- Joey Hess <joeyh@debian.org> Thu, 13 Jul 2006 16:58:20 -0400
moreutils (0.14) unstable; urgency=low
=head1 DESCRIPTION
vidir allows editing of the contents of a directory in a text editor. If no
-directory is specified, the current directory is edited. Each item in the
-directory is listed. Delete items to remove them from the directory, or
-edit their names to rename them.
+directory is specified, the current directory is edited.
+
+When editing a directory, each item in the directory will appear on its own
+numbered line. These numbers are how vidir keeps track of what items are
+changed. Delete lines to remove files from the directory, or
+edit filenames to rename files. You can also switch pairs of numbers to
+swap filenames.
Note that if "-" is specified as the directory to edit, it reads a list of
filenames from stdin and displays those for editing. Alternatively, a list
foreach (@dir) {
next if /(.*\/)?\.$/ || /(.*\/)?\.\.$/;
$item{++$c}=$_;
- print OUT "$c.\t$_\n";
+ print OUT "$c\t$_\n";
}
@dir=();
close OUT;
open (IN, $tmp->filename) || die "$0: cannot read ".$tmp->filename.": $!\n";
while (<IN>) {
chomp;
- if (/^(\d+)\.\t(.*)/) {
+ if (/^(\d+)\t{0,1}(.*)/) {
my $num=$1;
my $name=$2;
if (! exists $item{$num}) {
$error=1;
}
elsif ($name ne $item{$num}) {
+ next unless length $name;
my $src=$item{$num};
# deal with swaps
}
delete $item{$num};
}
+ elsif (/^\s*$/) {
+ # skip empty line
+ }
else {
die "$0: unable to parse line \"$_\", aborting\n";
}