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 2006-03-10 19:00:48 PST
Message User: sunny256
Date: 2006/03/10 19:00:48

Modified:
   svnutils/trunk/src/sident

Log:
 r166 | sunny256 | 2006-03-11 02:57:06 +0000 (Sat, 11 Mar 2006) | 9 lines
 
 sident: Synced against
 http://svn.sunbase.o​rg/repos/utils/trunk​/Lib/std/perl r1640.
 
 * /trunk/src/sident
   - New --version option.
   - New --debug option.
   - Minor changes in the help text.
   - Removed pretty spaces, only leads to potential merge trouble anyway.

File Changes:

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

File [changed]: sident
Url: http://svnutils.tigr​is.org/source/browse​/svnutils/trunk/src/​sident?r1=1.16&r​2=1.17
Delta lines: +69 -37
---------------------
--- sident 2 Oct 2005 01:30:53 -0000 1.16
+++ sident 11 Mar 2006 03:00:46 -0000 1.17
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 #===================​====================​====================​============
-# $Id: sident 162 2005-10-02 01:26:41Z sunny256 $
+# $Id: sident 166 2006-03-11 02:57:06Z sunny256 $
 # Lists RCS-like keywords in files. Replacement for ident(1).
 #
 # Character set: UTF-8
@@ -17,6 +17,7 @@
 our $Debug = 0;
 
 our %Opt = (
+ 'debug' => 0,
     'expanded' => 0,
     'filesfrom' => "",
     'help' => 0,
@@ -24,28 +25,34 @@
     'namesonly' => 0,
     'unique' => 0,
     'verbose' => 0,
+ 'version' => 0,
     'xml' => 0
 );
 
 our $progname = $0;
 $progname =~ s#^.*/(.*?)$#$1#;
 
-my $rcs_id = '$Id: sident 162 2005-10-02 01:26:41Z sunny256 $';
+my $rcs_id = '$Id: sident 166 2006-03-11 02:57:06Z sunny256 $';
 my $id_date = $rcs_id;
+$id_date =~ s/^.*?\d+ (\d\d\d\d-.*?\d​\d:\d\d:\d\d\S​+).*/$1/;
 
 Getopt::Long::Config​ure("bundling");
 GetOptions(
+ "debug" => \$Opt{'debug'},
     "expanded-only|e" => \$Opt{'expanded'},
- "help|h" => \$Opt{'help'},
     "filenames-from|f=s" => \$Opt{'filesfrom'},
+ "help|h" => \$Opt{'help'},
     "known-keywords-only|k" => \$Opt{'known'},
     "filenames-only|l" => \$Opt{'namesonly'},
     "unique-keywords|u" => \$Opt{'unique'},
     "verbose|v" => \$Opt{'verbose'},
+ "version" => \$Opt{'version'},
     "xml|x" => \$Opt{'xml'}
 ) || die("$progname: Option error. Use -h for help.\n");
 
+$Opt{'debug'} && ($Debug = 1);
 $Opt{'help'} && usage(0);
+$Opt{'version'} && print_version();
 
 my @Keywords = (
                 "Id",
@@ -153,9 +160,14 @@
 
 $Opt{'xml'} && print("</sident>\n");
 
-sub usage {
- # Send the help message to stdout {{{
- my $Retval = shift;
+sub print_version {
+ xml_print("$rcs_id\n");
+ exit(0);
+}
+
+sub xml_print {
+ # Print out some text, using DocBook if --xml is specified {{{
+ my $Txt = shift;
     my ($xml_start, $xml_end) =
        ( "", "");
 
@@ -171,7 +183,20 @@
 </article>
 END
     }
- my $Txt = <<END;
+
+ printf("%s%s%s",
+ $xml_start,
+ $Opt{'xml'} ? txt_to_xml($Txt) : "\n$Txt\n",
+ $xml_end
+ );
+ # }}}
+}
+
+sub usage {
+ # Send the help message to stdout {{{
+ my $Retval = shift;
+
+ xml_print(<<END);
 $rcs_id
 
 Usage: $progname [options] [file [files [...]]]
@@ -181,29 +206,28 @@
 Options:
 
   -e, --expanded-only
- List only expanded keywords
+ 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
- Only list keywords known to Subversion and CVS
+ Only list keywords known to Subversion and CVS.
   -l, --filenames-only
       Suppress normal output; only list names of files which contain
- keywords
+ keywords.
   -u, --unique-keywords
       List keywords only once per file, avoid duplicates.
   -v, --verbose
       Also list files without keywords.
+ --version
+ Print version information.
   -x, --xml
- Create XML output
+ Create XML output.
+ --debug
+ Print debugging messages.
 END
- printf("%s%s%s",
- $xml_start,
- $Opt{'xml'} ? txt_to_xml($Txt) : "\n$Txt\n",
- $xml_end
- );
     exit($Retval);
     # }}}
 }
@@ -253,7 +277,7 @@
 
 =head1 REVISION
 
-$Id: sident 162 2005-10-02 01:26:41Z sunny256 $
+$Id: sident 166 2006-03-11 02:57:06Z sunny256 $
 
 =head1 SYNOPSIS
 
@@ -297,10 +321,18 @@
 
 In addition to list keywords, also list names of files without keywords.
 
+=item B<--version>
+
+Print version information.
+
 =item B<-x>, B<--xml>
 
 Create XML output.
 
+=item B<--debug>
+
+Print debugging messages.
+
 =back
 
 =head1 BUGS
@@ -341,4 +373,4 @@
 # }}}
 
 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :
-# End of file $Id: sident 162 2005-10-02 01:26:41Z sunny256 $
+# End of file $Id: sident 166 2006-03-11 02:57:06Z 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 2006-03-10 19:00:48 PST
Messages per page: