You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Blair Zajac <bl...@orcaware.com> on 2002/07/02 16:30:10 UTC

Re: svn commit: rev 2393 - trunk/tools/client-side

kfogel@tigris.org wrote:
> 
> Author: kfogel
> Date: Tue, 02 Jul 2002 09:32:36 -0500
> New Revision: 2393
> 
> Modified:
>    trunk/tools/client-side/search-svnlog.pl
> Log:
> * subversion/tools/client-side/search-svnlog.pl: Add -f option to take
>   log data from a file.
> 
>  use strict;
> 
>  my $filter = shift || die ("Usage: $0 REGEXP\n");
> +
> +# ### Could do real option parsing here...
> +my $dash_f = shift;
> +my $logfile;
> +if (defined ($dash_f) && ($dash_f eq "-f")) {
> +  $logfile = shift;
> +  die ("-f option needs argument") if (! $logfile);

A file named '0' will cause a failure here.  I like to use

die ("-f option needs argument") unless length $logfile;

> +}
> +elsif (defined ($dash_f)) {
> +  die ("unknown option ${dash_f}");
> +}
> +
> +
>  my $log_cmd = "svn log";
> 
>  my $log_separator =
>    "------------------------------------------------------------------------\n";
> 
> -open (LOG_OUT, "$log_cmd |") or die ("Unable to run \"$log_cmd\".\n");
> +if ($logfile) {

Same here.

Best,
Blair

-- 
Blair Zajac <bl...@orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 2393 - trunk/tools/client-side

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Blair Zajac <bl...@orcaware.com> writes:
> I can put in the Perl option parsing code using the standard
> modules.  Let me know.

You know, that would be the best solution all around, especially
anticipating future features.  Please go for it!...

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 2393 - trunk/tools/client-side

Posted by Blair Zajac <bl...@orcaware.com>.
Blair Zajac wrote:
> 
> kfogel@tigris.org wrote:
> >
> > Author: kfogel
> > Date: Tue, 02 Jul 2002 09:32:36 -0500
> > New Revision: 2393
> >
> > Modified:
> >    trunk/tools/client-side/search-svnlog.pl
> > Log:
> > * subversion/tools/client-side/search-svnlog.pl: Add -f option to take
> >   log data from a file.
> >
> >  use strict;
> >
> >  my $filter = shift || die ("Usage: $0 REGEXP\n");
> > +
> > +# ### Could do real option parsing here...
> > +my $dash_f = shift;
> > +my $logfile;
> > +if (defined ($dash_f) && ($dash_f eq "-f")) {
> > +  $logfile = shift;
> > +  die ("-f option needs argument") if (! $logfile);
> 
> A file named '0' will cause a failure here.  I like to use
> 
> die ("-f option needs argument") unless length $logfile;

Actually, with the code flow, $logfile can be undefined, so
it should use "unless defined $logfile".

I can put in the Perl option parsing code using the standard
modules.  Let me know.

Best,
Blair

-- 
Blair Zajac <bl...@orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org