Andy Lester > ack-1.96 > App::Ack

Download:
ack-1.96.tar.gz

Dependencies

Annotate this POD (1)

Website

View/Report Bugs
Module Version: 1.96   Source   Latest Release: ack-2.13_06

NAME ^

App::Ack - A container for functions for the ack program

VERSION ^

Version 1.94

SYNOPSIS ^

If you want to know about the ack program, see the ack file itself.

No user-serviceable parts inside. ack is all that should use this.

FUNCTIONS ^

read_ackrc

Reads the contents of the .ackrc file and returns the arguments.

get_command_line_options()

Gets command-line arguments and does the Ack-specific tweaking.

def_types_from_ARGV

Go through the command line arguments and look for --type-set foo=.foo,.bar and --type-add xml=.rdf. Remove them from @ARGV and add them to the supported filetypes, i.e. into %mappings, etc.

delete_type

Removes a type from the internal structures containing type information: %mappings, %types and %type_wanted.

ignoredir_filter

Standard filter to pass as a File::Next descend_filter. It returns true if the directory is any of the ones we know we want to ignore.

remove_dir_sep( $path )

This functions removes a trailing path separator, if there is one, from its argument

filetypes( $filename )

Returns a list of types that $filename could be. For example, a file foo.pod could be "perl" or "parrot".

The filetype will be undef if we can't determine it. This could be if the file doesn't exist, or it can't be read.

It will be 'skipped' if it's something that ack should avoid searching, even under -a.

is_searchable( $filename )

Returns true if the filename is one that we can search, and false if it's one that we should skip like a coredump or a backup file.

Recognized files: /~$/ - Unix backup files /#.+#$/ - Emacs swap files /[._].*\.swp$/ - Vi(m) swap files /core\.\d+$/ - core dumps /[.-]min\.js$/ - Minified javascript files

Note that $filename must be just a file, not a full path.

build_regex( $str, \%opts )

Returns a regex object based on a string and command-line options.

Dies when the regex $str is undefinied (i.e. not given on command line).

check_regex( $regex_str )

Checks that the $regex_str can be compiled into a perl regular expression. Dies with the error message if this is not the case.

No return value.

warn( @_ )

Put out an ack-specific warning.

die( @_ )

Die in an ack-specific way.

filetypes_supported()

Returns a list of all the types that we can detect.

show_help()

Dumps the help page to the user.

show_help_types()

Display the filetypes help subpage.

get_version_statement

Returns the version information for ack.

print_version_statement

Prints the version information for ack.

get_copyright

Return the copyright for ack.

load_colors

Set default colors, load Term::ANSIColor

is_interesting

File type filter, filtering based on the wanted file types

search_resource( $resource, \%opt )

Main search method.

Assumes an open resource, and that the caller will close the resource.

print_match_or_context( $opt, $is_match, $starting_line_no, $match_start, $match_end, @lines )

Prints out a matching line or a line of context around a match.

search_and_list( $res, \%opt )

Optimized version of searching for -l and --count, which do not show lines.

filetypes_supported_set

True/False - are the filetypes set?

print_files( $iter, $one [, $regex, [, $ors ]] )

Prints all the files returned by the iterator matching $regex.

If $one is set, stop after the first. The output record separator $ors defaults to "\n" and defines, what to print after each filename.

print_files_with_matches( $iter, $opt )

Prints the name of the files where a match was found.

print_matches( $iter, $opt )

Print matching lines.

filetype_setup()

Minor housekeeping before we go matching files.

expand_filenames( \@ARGV )

Returns reference to list of expanded filename globs (Win32 only).

get_starting_points( \@ARGV, \%opt )

Returns reference to list of starting directories and files.

get_iterator

Return the File::Next file iterator

input_from_pipe()

Returns true if ack's input is coming from a pipe.

output_to_pipe()

Returns true if ack's input is coming from a pipe.

exit_from_ack

Exit from the application with the correct exit code.

Returns with 0 if a match was found, otherwise with 1. The number of matches is handed in as the only argument.

COPYRIGHT & LICENSE ^

Copyright 2005-2011 Andy Lester.

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License v2.0.

syntax highlighting: