From b3f623cbd5ea66560165ad1c4f9fab691b0174e5 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 8 Apr 2023 23:20:52 +0200 Subject: [PATCH] subparser import --- import_export_canalblog.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/import_export_canalblog.py b/import_export_canalblog.py index 4c828cc..ed55576 100644 --- a/import_export_canalblog.py +++ b/import_export_canalblog.py @@ -7,14 +7,19 @@ import WPImport if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument("--user", help="wordpress user", required=True) - parser.add_argument("--file", help="HTML file", default="") - parser.add_argument("--directory", help="HTML directory", default="") - parser.add_argument("--wordpress", help="URL Wordpress", required=True) parser.add_argument("--debug", help="Verbosity", action="store_true") parser.add_argument("--logfile", help="Log file", default="") parser.add_argument("--quiet", help="No console output", action="store_true") + subparsers = parser.add_subparsers() + + import_parser = subparsers.add_parser("import") + import_parser.add_argument("--user", help="wordpress user", required=True) + import_parser.add_argument("--file", help="HTML file", default="") + import_parser.add_argument("--directory", help="HTML directory", default="") + import_parser.add_argument("--wordpress", help="URL Wordpress", required=True) + + args = parser.parse_args() logger = logging.getLogger('insert wordpress') formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')