NAME
swish-filter-test - program to test the SWISH::Filter module.
SYNOPSIS
swish-filter-test [options] <file or url> <...>
Options:
-quiet don't generate messages to stderr
-content output content to stdout
-(no)skip_binary skip output of binary files (default)
-lines <num> Number of lines of content to display to stderr if verbose
-headers output with headers for swish-e -S prog method
-verbose enable $ENV{FILTER_DEBUG} for verbose output
-path output @INC path to SWISH::Filter module
-help brief help message
-man full documentation
-ignore <filter> ignore <filter> in selecting a filter to use
DESCRIPTION
swish-filter-test is a program to test the Perl module SWISH::Filter. SWISH::Filter is a module that is included with the swish-e distribution.
Documents supplied to this script (as a URL or a plain file) on the command line are passed to the SWISH::Filter module. This is useful for testing filters.
The SWISH::Filter module works by checking a document's content-type and looking for an available filter. Most filters require additional helper programs (e.g. the filter to convert PDF to HTML requires the Xpdf package). Using the -verbose options should indicate if a required program is missing.
Options to this script control how much output is generated. Options can also be specified to generate output that can be piped directly to swish-e (see -headers below).
All messages are sent to stderr unless --content or -headers are specified and then content is sent to stdout.
OPTIONS
- -quiet
-
Don't write info out to stderr. Normally not useful unless you just want to filter a document and not really test the SWISH::Filter module.
Fatal errors are written to stderr error regardless of the -quiet option.
- -verbose
-
Enables FILTER_DEBUG mode in the SWISH::Filter module, and enables extra info including a summary of the filtered document to stderr. Enable if trying to find out why a filter does not work.
- -lines
-
Number of summary lines of summary content to show. Summary lines are only showed if -verbose is selected. Lines are sent to stderr, not stdout.
Note, the summary is limited to 1000 characters regardless of this option.
- -content
-
Specifying -content will output full content to stdout. The default is to only display a few lines.
- -(no)skip_binary
-
The default is to not output content from binary files. -noskip_binary will disable this.
- -headers
-
Prints the headers used by swish-e when reading documents with -S prog. This can be used to filter documents directly to swish-e:
swish-filter-test -headers -content http://localhost/ test.pdf | swish-e -S prog -i stdin -v1 - -path
-
Prints the installed location of the SWISH::Filter parent directory for use in PERL5LIB, Allows using SWISH::Filter in other programs, or with the Swish-e -S http method with swishspider.
For example:
PERL5LIB=`swish-filter-test -path` swish-e -S http -i http://localhost - -help
-
Print a brief help message and exits.
- -man
-
Prints the manual page and exits.