diff -r 91803f1e2741 -r bce276394054 exigrey.pl --- a/exigrey.pl Wed Jan 03 08:55:02 2007 +0000 +++ b/exigrey.pl Wed Jan 03 09:21:21 2007 +0000 @@ -6,10 +6,11 @@ use constant USAGE => <<'#'; -Usage: !ME! item [delay [db]] - !ME! --list [db] - !ME! --stat [db] - !ME! --clean [days [db]] +Usage: !ME! --insert item [delay [db]] # insert an item + !ME! --list [db] # list all items + !ME! --stat [db ...] # print short statistic + !ME! --clean [days [db ...]] # remove items not used since days + !ME! --dbs # list dbm files in default directory Defaults: delay: !$DEFAULT{delay}! db: !$DEFAULT{db}! @@ -33,8 +34,10 @@ my $opt_list; my $opt_stats; +my $opt_insert; my $opt_help; my $opt_clean; +my $opt_dbs; sub iterate(\%$); @@ -42,8 +45,10 @@ GetOptions( "list!" => \$opt_list, + "insert!" => \$opt_insert, "stats!" => \$opt_stats, "clean!" => \$opt_clean, + "dbs!" => \$opt_dbs, "help!" => \$opt_help, ) or die ME.": Bad usage, try ".ME." --help.\n"; @@ -120,7 +125,15 @@ exit 0; } - print unseen(@ARGV, 10) . "\n"; + if ($opt_dbs) { + print join("\n", glob(getDBDir() . "/*")), "\n"; + exit 0; + } + + if ($opt_insert) { + print unseen(@ARGV); + exit 0; + } } # Helper to iterate over our hash and call the passed