File-CodeSearch

 view release on metacpan or  search on metacpan

bin/cs  view on Meta::CPAN


A configuration file placed in ~/.csrc (or specified through --conf) allows
allows the setting of default values. See L<Config::General> for full details
of the file format.

Eg

  <default>
      smart = 1
  </default>

  <file_types>
      <perl>
          definite    = [.]pl$  # Definite match regexps can be specified mulitple
          definite    = [.]pm$  # times to form a list of definit matches
          definite    = [.]pod$ # Note this replaces the predefined list
          definite    = [.]PL$

          possible    = [.]t$   # As can possiple matches
          possible    = [.]cgi$

          none        = 1       # set files with out a suffix to match as perl files
          bang        = perl    # Causes the reading of the first line of a file
                                # to check if it contains /perl/ (and there fore matches)
      </perl>
      <python>
          +definite   = [.]pthony$ # Adds this regexp to the default list of
                                   # regexps that definitly phyton files
      </python>
  <file_types>

  <project proj>
    exclude = /path/to/excluded/dir
  </project>

  <project other_work>
    file-exclude = large[.]file$
  </project>

In the C<default> section, default values for command line options can be specified.

In the C<file_types> section, you can add new file types or override or change
existing file types.

In the project section, you can add defaults specific to a project which can
be specified on the command line as --project=proj

=head2 Pager

By default cs uses the command C<less -Rx4SFX> if it can run other wise it
falls back just writing to C<STDOUT>. You can change this environment variable
C<CS_PAGER_COLOR>

=head1 DEPENDENCIES

Some of the --smart capabilities (ie paging output) require the C<less> command
to be installed other wise the paging wont available.

=head1 INCOMPATIBILITIES

=head1 BUGS AND LIMITATIONS

There are no known bugs in this module.

Please report problems to Ivan Wills (ivan.wills@gmail.com).

Patches are welcome.

=head1 ALSO SEE

C<grep -r> - Recursive C<grep>, can be much faster but will search into version
control directories and has to be used with C<find> to limit the searched files.

L<ack> - This a very similar in syntax to C<grep> but can't do replacements which
C<cs> can.

=head1 AUTHOR

Ivan Wills - (ivan.wills@gmail.com)

=head1 LICENSE AND COPYRIGHT

Copyright (c) 2009 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077).
All rights reserved.

This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself. See L<perlartistic>.  This program is
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

=cut



( run in 0.834 second using v1.01-cache-2.11-cpan-524268b4103 )