Switch some other options to BooleanOptionalAction

This commit is contained in:
Joscha 2021-05-23 22:49:09 +02:00
parent edbd92dbbf
commit 79be6e1dc5

View File

@ -2,7 +2,7 @@ import argparse
import configparser import configparser
from pathlib import Path from pathlib import Path
from .parser import CRAWLER_PARSER, SUBPARSERS, load_crawler from .parser import CRAWLER_PARSER, SUBPARSERS, BooleanOptionalAction, load_crawler
SUBPARSER = SUBPARSERS.add_parser( SUBPARSER = SUBPARSERS.add_parser(
"kit-ilias-web", "kit-ilias-web",
@ -27,9 +27,7 @@ GROUP.add_argument(
) )
GROUP.add_argument( GROUP.add_argument(
"--videos", "--videos",
# TODO Use argparse.BooleanOptionalAction after updating to 3.9 action=BooleanOptionalAction,
action="store_const",
const=True,
help="crawl and download videos" help="crawl and download videos"
) )
GROUP.add_argument( GROUP.add_argument(
@ -46,9 +44,7 @@ GROUP.add_argument(
) )
GROUP.add_argument( GROUP.add_argument(
"--link-file-plaintext", "--link-file-plaintext",
# TODO Use argparse.BooleanOptionalAction after updating to 3.9 action=BooleanOptionalAction,
action="store_const",
const=True,
help="use plain text files for external links" help="use plain text files for external links"
) )