From 8a97f5cec2a22a5074154837ed4519ce70fcac69 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 13 Jun 2011 09:25:27 +0200 Subject: Add "hashl list " to filter listed files by name --- Changelog | 6 +++++- bin/hashl | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index a38c56d..5e5d34a 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,8 @@ -App::Hashl 0.2 - Mon May 23 2011 +git HEAD + + * Add "hashl list " to filter listed files by name + +hashl 0.2 - Mon May 23 2011 * The internal representation of ignored hashes was changed * hashl update no longer re-adds ignored (but existing) files diff --git a/bin/hashl b/bin/hashl index f1e6cf8..85825bc 100755 --- a/bin/hashl +++ b/bin/hashl @@ -341,6 +341,8 @@ sub cmd_info { } sub cmd_list { + my ($re) = @_; + printf( "# hashl v%s Read Size %d bytes (%s)\n", $VERSION, $hashl->read_size(), $hashl->si_size( $hashl->read_size() ), @@ -348,6 +350,11 @@ sub cmd_list { for my $name ( sort $hashl->files() ) { my $file = $hashl->file($name); + + if ( $re and $name !~ m{$re} ) { + next; + } + printf( "%s %-7s %s\n", $file->{hash}, $hashl->si_size( $file->{size} ), $name ); } @@ -443,10 +450,13 @@ files for B or B. Show information on I (or the database, if I is not specified). -=item B +=item B [I] List all files and their hashes. The list format is C<< hash size file >>. +If I (a perl regular expression) is specifed, only matching files will +be listed. + =item B List all filenames, one file per line. -- cgit v1.2.3