--- IO-AIO/bin/treescan 2008/04/09 18:18:41 1.2 +++ IO-AIO/bin/treescan 2009/06/07 22:28:05 1.3 @@ -7,15 +7,19 @@ use Getopt::Long; use IO::AIO; -Getopt::Long::Configure ("bundling", "no_ignore_case", "require_order"); +our $VERSION = $IO::AIO::VERSION; -my ($opt_silent, $opt_print0, $opt_stat); +Getopt::Long::Configure ("bundling", "no_ignore_case", "require_order", "auto_help", "auto_version"); + +my ($opt_silent, $opt_print0, $opt_stat, $opt_nodirs, $opt_nofiles); GetOptions "quiet|q" => \$opt_silent, "print0|0" => \$opt_print0, "stat|s" => \$opt_stat, -; + "dirs|d" => \$opt_nofiles, + "files|f" => \$opt_nodirs, + or die "Usage: try $0 --help"; @ARGV = "." unless @ARGV; @@ -38,8 +42,8 @@ aio_scandir $path, 8, sub { my ($dirs, $files) = @_; - printfn "", [$path]; - printfn $path, $files; + printfn "", [$path] unless $opt_nodirs; + printfn $path, $files unless $opt_nofiles; if ($opt_stat) { aio_lstat "$path$_" for @$files;