diff options
| author | 2022-05-26 23:57:04 -0400 | |
|---|---|---|
| committer | 2022-05-26 23:57:04 -0400 | |
| commit | ad61a6d8122973534ab63df48f6090954bc73db6 (patch) | |
| tree | aedce94427ac95fa180005f88fc94b5c8ef5a62a /gallery_dl/option.py | |
| parent | c6b88a96bd191711fc540d7babab3d2e09c68da8 (diff) | |
New upstream version 1.22.0.upstream/1.22.0
Diffstat (limited to 'gallery_dl/option.py')
| -rw-r--r-- | gallery_dl/option.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/gallery_dl/option.py b/gallery_dl/option.py index 782063d..b2a9aa8 100644 --- a/gallery_dl/option.py +++ b/gallery_dl/option.py @@ -39,8 +39,9 @@ class AppendCommandAction(argparse.Action): class DeprecatedConfigConstAction(argparse.Action): """Set argparse const values as config values + deprecation warning""" def __call__(self, parser, namespace, values, option_string=None): - print("warning: {} is deprecated. Use {} instead.".format( - "/".join(self.option_strings), self.choices), file=sys.stderr) + sys.stderr.write( + "warning: {} is deprecated. Use {} instead.\n".format( + "/".join(self.option_strings), self.choices)) namespace.options.append(((), self.dest, self.const)) @@ -59,7 +60,7 @@ class ParseAction(argparse.Action): class Formatter(argparse.HelpFormatter): """Custom HelpFormatter class to customize help output""" def __init__(self, *args, **kwargs): - super().__init__(max_help_position=50, *args, **kwargs) + super().__init__(max_help_position=30, *args, **kwargs) def _format_action_invocation(self, action): opts = action.option_strings[:] @@ -114,11 +115,6 @@ def build_parser(): "('/O' for \"original\" filenames)"), ) general.add_argument( - "--cookies", - dest="cookies", metavar="FILE", action=ConfigAction, - help="File to load additional cookies from", - ) - general.add_argument( "--proxy", dest="proxy", metavar="URL", action=ConfigAction, help="Use the specified proxy", @@ -134,6 +130,18 @@ def build_parser(): help="Delete cached login sessions, cookies, etc. for MODULE " "(ALL to delete everything)", ) + general.add_argument( + "--cookies", + dest="cookies", metavar="FILE", action=ConfigAction, + help="File to load additional cookies from", + ) + general.add_argument( + "--cookies-from_browser", + dest="cookies_from_browser", metavar="BROWSER[+KEYRING][:PROFILE]", + help=("Name of the browser to load cookies from, " + "with optional keyring name prefixed with '+' and " + "profile prefixed with ':'"), + ) output = parser.add_argument_group("Output Options") output.add_argument( |
