From 1b441b86756d8565dfc1e8c0c850e8e0c1e5da80 Mon Sep 17 00:00:00 2001 From: frederik-uni <147479464+frederik-uni@users.noreply.github.com> Date: Sat, 30 Nov 2024 22:38:12 +0100 Subject: [PATCH] why does the order matter? --- manga_translator/args.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manga_translator/args.py b/manga_translator/args.py index 06846b944..72a717a1c 100644 --- a/manga_translator/args.py +++ b/manga_translator/args.py @@ -78,6 +78,8 @@ def _format_action_invocation(self, action: argparse.Action) -> str: parser = argparse.ArgumentParser(prog='manga_translator', description='Seamlessly translate mangas into a chosen language', formatter_class=HelpFormatter) +subparsers = parser.add_subparsers(dest='mode', required=True, help='Mode of operation') + parser.add_argument('-v', '--verbose', action='store_true', help='Print debug info and save intermediate images in result folder') parser.add_argument('--attempts', default=0, type=int, help='Retry attempts on encountered error. -1 means infinite times.') parser.add_argument('--ignore-errors', action='store_true', help='Skip image on encountered error.') @@ -90,8 +92,6 @@ def _format_action_invocation(self, action: argparse.Action) -> str: parser.add_argument('--post-dict', default=None, type=file_path, help='Path to the post-translation dictionary file') parser.add_argument('--kernel-size', default=3, type=int, help='Set the convolution kernel size of the text erasure area to completely clean up text residues') -subparsers = parser.add_subparsers(dest='mode', required=True, help='Mode of operation') - # Batch mode parser_batch = subparsers.add_parser('local', help='Run in batch translation mode') parser_batch.add_argument('-i', '--input', required=True, type=path, nargs='+', help='Path to an image folder')