lgstool: Lift out the common argument parsing

Instead of repeating the same command-line argument parsing code in
each function, lift it out into one function, and use that in the
commands instead.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lgstool: Only expose some functions to the CLI

Instead of exposing all functions within the namespace to the CLI,
only expose the commands. We accomplish this by enforcing an
'lgstool-' prefix on them.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lgstool: Use a higher order function for printing

Instead of calling print-message directly, take a printer function as
the first argument for all the lgstool- commands. While there, take
advantage of this in the test suite.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lgstool: Add a test case for the 'inspect' command

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lgstool: Tests for the 'search' command

These are comprehensive tests for the 'search' command, testing all
predicates in multiple ways. This fixes #9.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Merge branch 'feature/lgstool/cli-refactor'

Signed-off-by: Gergely Nagy <algernon@balabit.hu>