+ my @files;
+ # XXX some options:
+ # a. take message numbers on stdin
+ # b. take full paths to messages on stdin
+ # c. take standard [msgs] list on command-line
+ # d. assume inc has just finished so cur points to start of new mail and
+ # just do cur-last
+ # Hacked up b. here, but I'm not happy with it. I'm renaming files that
+ # stay in inbox for no reason, and leaving gaping holes. Any of the above
+ # approaches has those problems, and the solution is always the same:
+ # # Keep track of the message numbers we've renamed out of inbox
+ # my @filtered;
+ # for (@msgs) {
+ # if (!my $new = filter($_)) {
+ # # If @filtered is empty, this message already has the right number.
+ # $new = shift(@filtered) || next;
+ # }
+ # push(@filtered, $_);
+ # rename($_, $new);
+ # }
+
+ if (@ARGV > 0) {
+ # XXX if sticking with this approach, reject arg other than '-'
+ chomp(@files = <>);
+ @files > 0 || exit 0;
+ } else {
+ chdir("$MAILDIR/new") or die("chdir($MAILDIR/new): $!");
+ @files = getfiles('.');
+ }
+