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 --- bin/hashl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'bin/hashl') 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