swish-filter-test - program to test the SWISH::Filter module.


swish-filter-test [options] <file or url> <...>

   -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


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.



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.


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.


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.


Specifying -content will output full content to stdout. The default is to only display a few lines.


The default is to not output content from binary files. -noskip_binary will disable this.


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

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

Print a brief help message and exits.


Prints the manual page and exits.