in reply to peg - Perl _expression_ (GNU) grep script

How would I make this ignore all files beyound a .cvs or .svn directory? Also: ++


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: peg - Perl _expression_ (GNU) grep script
by Clarendon4 (Acolyte) on Nov 14, 2008 at 20:36 UTC
    To skip files beneath a directory, use -p with a suitable regex against the $File variable. eg
    peg -p "$File !~ m#(^|/)(?:\.cvs|\.svn)/#" foobar
    But you'll quickly tire of typing that, so add this to your PEG_OPTIONS in your "peg_ini.pl" file:
    $ENV{'PEG_OPTIONS'} .= ' -p "$File !~ m#(^|/)(?:\.cvs|\.svn)/#" ';
      This can now be done much more simply - just add:
      push @Exclude_dirs, ".svn", ".cvs";
      ... to one of the "peg_ini.pl" files.