1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-23 03:02:50 +01:00

reword some (internal) option text

This commit is contained in:
Mike Fährmann 2023-11-15 14:59:03 +01:00
parent 51e377e612
commit 387c8b0950
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -44,23 +44,23 @@ class DeprecatedConfigConstAction(argparse.Action):
namespace.options.append(((), self.dest, self.const)) namespace.options.append(((), self.dest, self.const))
class ParseAction(argparse.Action): class ConfigParseAction(argparse.Action):
"""Parse <key>=<value> options and set them as config values""" """Parse KEY=VALUE config options"""
def __call__(self, parser, namespace, values, option_string=None): def __call__(self, parser, namespace, values, option_string=None):
key, value = _parse_option(values) key, value = _parse_option(values)
key = key.split(".") # splitting an empty string becomes [""] key = key.split(".") # splitting an empty string becomes [""]
namespace.options.append((key[:-1], key[-1], value)) namespace.options.append((key[:-1], key[-1], value))
class OptionAction(argparse.Action): class PPParseAction(argparse.Action):
"""Parse <key>=<value> options for """ """Parse KEY=VALUE post processor options"""
def __call__(self, parser, namespace, values, option_string=None): def __call__(self, parser, namespace, values, option_string=None):
key, value = _parse_option(values) key, value = _parse_option(values)
namespace.options_pp[key] = value namespace.options_pp[key] = value
class InputfileAction(argparse.Action): class InputfileAction(argparse.Action):
"""Process input files""" """Collect input files"""
def __call__(self, parser, namespace, value, option_string=None): def __call__(self, parser, namespace, value, option_string=None):
namespace.input_files.append((value, self.const)) namespace.input_files.append((value, self.const))
@ -334,7 +334,8 @@ def build_parser():
configuration = parser.add_argument_group("Configuration Options") configuration = parser.add_argument_group("Configuration Options")
configuration.add_argument( configuration.add_argument(
"-o", "--option", "-o", "--option",
dest="options", metavar="KEY=VALUE", action=ParseAction, default=[], dest="options", metavar="KEY=VALUE",
action=ConfigParseAction, default=[],
help=("Additional options. " help=("Additional options. "
"Example: -o browser=firefox") , "Example: -o browser=firefox") ,
) )
@ -565,8 +566,9 @@ def build_parser():
) )
postprocessor.add_argument( postprocessor.add_argument(
"-O", "--postprocessor-option", "-O", "--postprocessor-option",
dest="options_pp", metavar="OPT", action=OptionAction, default={}, dest="options_pp", metavar="KEY=VALUE",
help="Additional '<key>=<value>' post processor options", action=PPParseAction, default={},
help="Additional post processor options",
) )
return parser return parser