Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
10b14224cc committed Jan 31, 2022
1 parent 3e5888c commit 9de3989
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pdfsak
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ def run(args):
shutil.rmtree(temp_dir)


def parse_args(cmdargs):
def get_parser():
# Get command line options
# This formatter class prints default values in help
# See: https://stackoverflow.com/questions/12151306/argparse-way-to-include-default-values-in-help
Expand Down Expand Up @@ -1308,7 +1308,7 @@ def parse_args(cmdargs):
"--debug-folder", type=str, default="temp", help=argparse.SUPPRESS
)

return parser.parse_args(cmdargs)
return parser


def main(cmdargs, args=None):
Expand All @@ -1317,15 +1317,16 @@ def main(cmdargs, args=None):
global debug
global previous_cwd

# Parse arguments
if args is None:
parser = get_parser()
args = parser.parse_args(cmdargs)

# If no options are passed, display help
if len(sys.argv) == 1:
parser.print_help(sys.stderr)
printMsgAndExit(None, EXIT_SUCCESS)

# Parse arguments
if args is None:
args = parse_args(cmdargs)

debug = args.debug

if args.check_all:
Expand Down

0 comments on commit 9de3989

Please sign in to comment.