Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /svnutils/trunk/src/

svnutils
Discussion topic

Back to topic list

CVS update: /svnutils/trunk/src/

Author sunny256
Full name Øyvind A. Holm
Date 2005-10-01 18:30:56 PDT
Message User: sunny256
Date: 2005/10/01 18:30:56

Modified:
   svnutils/trunk/src/sident

Log:
 r162 | sunny256 | 2005-10-02 01:26:41 +0000 (Sun, 02 Oct 2005) | 5 lines
 
 * /trunk/src/sident
   Added the "-f"/"--filenames-from" option for reading filenames from a
   file or stdin. It behaves like the tar(1) "-T" option by adding those
   filenames after filenames on the command line.

File Changes:

Directory: /svnutils/trunk/src/
===============================

File [changed]: sident
Url: http://svnutils.tigr​is.org/source/browse​/svnutils/trunk/src/​sident?r1=1.15&r​2=1.16
Delta lines: +29 -5
--------------------
--- sident 23 Aug 2005 00:19:17 -0000 1.15
+++ sident 2 Oct 2005 01:30:53 -0000 1.16
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 #===================​====================​====================​============
-# $Id: sident 161 2005-08-23 00:16:23Z sunny256 $
+# $Id: sident 162 2005-10-02 01:26:41Z sunny256 $
 # Lists RCS-like keywords in files. Replacement for ident(1).
 #
 # Character set: UTF-8
@@ -18,6 +18,7 @@
 
 our %Opt = (
     'expanded' => 0,
+ 'filesfrom' => "",
     'help' => 0,
     'known' => 0,
     'namesonly' => 0,
@@ -29,13 +30,14 @@
 our $progname = $0;
 $progname =~ s#^.*/(.*?)$#$1#;
 
-my $rcs_id = '$Id: sident 161 2005-08-23 00:16:23Z sunny256 $';
+my $rcs_id = '$Id: sident 162 2005-10-02 01:26:41Z sunny256 $';
 my $id_date = $rcs_id;
 
 Getopt::Long::Config​ure("bundling");
 GetOptions(
     "expanded-only|e" => \$Opt{'expanded'},
     "help|h" => \$Opt{'help'},
+ "filenames-from|f=s" => \$Opt{'filesfrom'},
     "known-keywords-only|k" => \$Opt{'known'},
     "filenames-only|l" => \$Opt{'namesonly'},
     "unique-keywords|u" => \$Opt{'unique'},
@@ -68,7 +70,21 @@
 END
 }
 
-for (@ARGV) {
+my @Files = @ARGV;
+
+if (length($Opt{'filesfrom'})) {
+ if (open(FromFP, "<$Opt{'filesfrom'}")) {
+ while(<FromFP>) {
+ chomp;
+ push(@Files, $_);
+ }
+ close(FromFP);
+ } else {
+ die("$progname: $Opt{'filesfrom'}: Cannot read filenames from file: $!\n");
+ }
+}
+
+for (@Files) {
     my @Out = ();
     my $File = $_;
     if (open(FromFP, "<$File")) {
@@ -166,6 +182,9 @@
 
   -e, --expanded-only
       List only expanded keywords
+ -f, --filenames-from x
+ Read filenames from file x in addition to files specified on the
+ command line.
   -h, --help
       Show this help.
   -k, --known-keywords-only
@@ -234,7 +253,7 @@
 
 =head1 REVISION
 
-$Id: sident 161 2005-08-23 00:16:23Z sunny256 $
+$Id: sident 162 2005-10-02 01:26:41Z sunny256 $
 
 =head1 SYNOPSIS
 
@@ -252,6 +271,11 @@
 
 List only expanded keywords.
 
+=item B<-f>, B<--filenames-from> x
+
+Read filenames from file F<x> in addition to files specified on the
+command line.
+
 =item B<-h>, B<--help>
 
 Print a brief help summary.
@@ -317,4 +341,4 @@
 # }}}
 
 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :
-# End of file $Id: sident 161 2005-08-23 00:16:23Z sunny256 $
+# End of file $Id: sident 162 2005-10-02 01:26:41Z sunny256 $

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /svnutils/trunk/src/ sunny256 Øyvind A. Holm 2005-10-01 18:30:56 PDT
Messages per page: