Skip to content

Command line reference

Every flag of the sillybos command, as its own --help prints them, generated from the parser at build time. The README shows what a run looks like.

The sillybos command: check files, print verdicts, exit non-zero on a refusal.

For a shell pipeline or a Dockerfile:

sillybos scans/*.tif && run-the-ocr scans/

Exit status 0 when every file passed, 1 when any was refused, 2 when the command could not do its job (a missing file, no pdfinfo for a PDF).

usage: sillybos [-h] [--version] [--strict] [--formats LIST] [--max-bytes N]
                [--max-pixels N] [--max-side N] [--max-pages N]
                [--max-metadata-bytes N] [--jpeg-frames LIST]
                [--png-colour-types LIST] [--max-png-bit-depth N]
                [--interlaced-png] [--no-tiled-tiff]
                [--tiff-photometrics LIST] [--tiff-subsamplings LIST]
                [--tiff-compressions LIST] [--pdf-features LIST] [--any-name]
                [--json] [-q]
                FILE [FILE ...]

Decide before decoding: say whether each file is one of the formats a scan can
be, within the limits, before any image library or PDF renderer opens it.

positional arguments:
  FILE

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --strict              the strict preset, for files from outside
  --formats LIST        comma-separated formats to allow, from
                        jpeg,png,tiff,pdf (default: all four)
  --max-bytes N         largest file, in bytes
  --max-pixels N        most pixels in any one page or frame
  --max-side N          most pixels along either side of any one page, frame
                        or tile
  --max-pages N         most pages or frames
  --max-metadata-bytes N
                        largest metadata block (a PNG chunk, a TIFF tag's
                        data, a JPEG colour profile)
  --jpeg-frames LIST    comma-separated JPEG frame codings to allow, from base
                        line,extended,progressive,lossless,hierarchical,arithm
                        etic (default: the first three)
  --png-colour-types LIST
                        comma-separated PNG colour types to allow, from
                        greyscale,rgb,palette,greyscale-alpha,rgba (default:
                        all five)
  --max-png-bit-depth N
                        deepest PNG sample (default: 16)
  --interlaced-png      do not refuse an interlaced PNG
  --no-tiled-tiff       refuse a TIFF laid out in tiles
  --tiff-photometrics LIST
                        comma-separated TIFF photometric interpretations to
                        allow, by name (default:
                        greyscale,rgb,palette,cmyk,ycbcr)
  --tiff-subsamplings LIST
                        comma-separated YCbCr subsamplings to allow, as 2x2
                        (default: 1x1,2x1,1x2,2x2)
  --tiff-compressions LIST
                        comma-separated TIFF compression schemes to allow, by
                        name (default: none,ccitt,lzw,jpeg,deflate,packbits)
  --pdf-features LIST   comma-separated PDF features to allow, from
                        javascript,forms,attachments,launch (default: none)
  --any-name            do not refuse a file whose extension disagrees with
                        its contents
  --json                one JSON object per line
  -q, --quiet           print only the files that were refused