summarylogtreecommitdiffstats
path: root/mupdfgrep
blob: 1d74259997c9971dd2d7a53487d36361b0c22683 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
getopts "cih" option
case $option in
  c)
    GREP_OPTIONS+=" --color=auto"
  ;;
  i)
  GREP_OPTIONS+=" -i"
  ;;
  h)
    echo "usage: $0 [options] query file.pdf"
    echo
    echo "options:"
    echo "  -c                     enable colored output"
    echo "  -i                     disable case sensitivity"
esac

if [ "$option" != "h" ]
then
  if [ "$option" != "?" ]
  then
    pdftxt "$3" | grep "$2"
  else
    pdftxt "$2" | grep "$1"
  fi
fi