Skip to content

Commit

Permalink
Add support for regex matching
Browse files Browse the repository at this point in the history
  • Loading branch information
srirangav committed Jul 22, 2022
1 parent 4b543eb commit 32c0120
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 43 deletions.
27 changes: 25 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
README
------

pdfview v.0.2.1
pdfview v.0.3.0

Homepage:

Expand All @@ -22,7 +22,25 @@ About:

Usage:

pdfview [files]
Generally:

pdfview [files]

On MacOSX:

pdfview [-q] [-n] [-e expression [-i]] [files]

If -q is specified, no error or information messages are printed.

If -n is specified, the filename and page number are printed for
each line.

If -e is specified, only lines matching the specified expression
are printed.

If -i is specified, then expression matching will be performed on
a case insensitive basis. If an expression is not specified, this
option is ignored.

Build (MacOSX only):

Expand Down Expand Up @@ -65,6 +83,7 @@ Install:

History:

v.0.3.0 Add support for regex matching to the MacOSX version
v.0.2.1 Add page numbering support to MacOSX version
v.0.2.0 Add PDFKit based implementation for MacOSX
v.0.1.3 Fixes based on shellcheck
Expand All @@ -79,6 +98,10 @@ Platforms:
been tested on FreeBSD (13.0), OpenBSD (7.0), and Debian (11.x).
It should work on other systems that have pdftotext installed.

Notes:

On MacOSX, regex matching requires MacOSX 10.7 or newer.

References:

https://stackoverflow.com/questions/3570591
Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for pdfview 0.1.0.
# Generated by GNU Autoconf 2.71 for pdfview 0.3.0.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -610,8 +610,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='pdfview'
PACKAGE_TARNAME='pdfview'
PACKAGE_VERSION='0.1.0'
PACKAGE_STRING='pdfview 0.1.0'
PACKAGE_VERSION='0.3.0'
PACKAGE_STRING='pdfview 0.3.0'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -1228,7 +1228,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures pdfview 0.1.0 to adapt to many kinds of systems.
\`configure' configures pdfview 0.3.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1290,7 +1290,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of pdfview 0.1.0:";;
short | recursive ) echo "Configuration of pdfview 0.3.0:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1370,7 +1370,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
pdfview configure 0.1.0
pdfview configure 0.3.0
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1493,7 +1493,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by pdfview $as_me 0.1.0, which was
It was created by pdfview $as_me 0.3.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -6733,7 +6733,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by pdfview $as_me 0.1.0, which was
This file was extended by pdfview $as_me 0.3.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -6788,7 +6788,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
pdfview config.status 0.1.0
pdfview config.status 0.3.0
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.

AC_INIT([pdfview],[0.1.0],[[email protected]])
AC_INIT([pdfview],[0.3.0],[[email protected]])

# We want to turn on warnings if we are using gcc and the user did
# not specify CFLAGS. The autoconf check for the C compiler sets the
Expand Down
21 changes: 15 additions & 6 deletions pdfview.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@
.SH NAME
pdfview \- a simple utility for viewing the text in PDFs
.SH SYNOPSIS
pdfview [\-q] [\-n] [files]
pdfview [\-q] [\-n] [\-e expression [\-i]] [files]
.SH DESCRIPTION
pdfview is a simple utility for viewing the text in a PDF.
.TP
.B \-e expression
Enables expression matching - only lines matching the specified
expression will be printed.
.TP
.B \-i
Enables case insensitive matching. If an expression is not
specified, this option is ignored.
.TP
.B \-q
Enables quiet mode \- pdfview will not print out error messages.
Enables quiet mode \- error messages will not be printed.
.TP
.B \-n
Enables page numbering \- pdfview will prefix each line of a
given pdf with the filename and page number
Enables page numbering \- each line of a given pdf will be
prefixed with the filename and page number.
.SH PLATFORMS
pdfview has been tested on MacOSX 11.x (BigSur) on M1. It
should work on MacOSX 10.4 (Tiger) and newer.
should work on MacOSX 10.4 (Tiger) and newer. Expression
matching should be available on MacOSX 10.7 (Lion) and newer.
.SH HISTORY
pdfview was written by Sriranga Veeraraghavan <[email protected]>.
pdfview was written by Sriranga Veeraraghavan.
Loading

0 comments on commit 32c0120

Please sign in to comment.