Skip to content

Commit

Permalink
CLI: minor style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mara004 committed Sep 1, 2022
1 parent 30d1222 commit 36c95aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/pypdfium2/_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,17 @@

def parse_args(argv=sys.argv[1:]):

if IS_SOURCEBUILD:
build_type = "source build"
else:
build_type = "official build"

parser = argparse.ArgumentParser(
prog = "pypdfium2",
description = "Command line interface to the pypdfium2 Python library",
)
parser.add_argument(
"--version", "-v",
action = "version",
version = "pypdfium2 %s (libpdfium %s, %s)" % (V_PYPDFIUM2, V_LIBPDFIUM, build_type),
version = "pypdfium2 %s (libpdfium %s, %s)" % (
V_PYPDFIUM2, V_LIBPDFIUM,
"source build" if IS_SOURCEBUILD else "official build",
),
)

subparsers = parser.add_subparsers(dest="subcommand")
Expand Down
2 changes: 2 additions & 0 deletions src/pypdfium2/_cli/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def crop_type(string):
raise ValueError("Crop must be a list of four numbers.")
return crop


ColorSchemeOpt = dict(
default = None,
metavar = "C",
Expand All @@ -34,6 +35,7 @@ def crop_type(string):
help = "Option for rendering with custom color scheme.",
)


def attach_parser(subparsers):
parser = subparsers.add_parser(
"render",
Expand Down

0 comments on commit 36c95aa

Please sign in to comment.