rename '--images' and '--chapters'

... to '--range' and '--chapter-range' to be consistent with
'--filter' and '--chapter-filter'
This commit is contained in:
Mike Fährmann
2017-09-23 17:31:40 +02:00
parent 8963da8fd8
commit 8a97bd0433
2 changed files with 26 additions and 7 deletions

View File

@@ -150,6 +150,17 @@ def main():
except OSError as exc: except OSError as exc:
log.warning("unsupported-URL file: %s", exc) log.warning("unsupported-URL file: %s", exc)
if args.depr_images is not None:
log.warning("--images is deprecated. "
"Use --range instead.")
if args.image_range is None:
args.image_range = args.depr_images
if args.depr_chapters is not None:
log.warning("--chapters is deprecated. "
"Use --chapter-range instead.")
if args.chapter_range is None:
args.chapter_range = args.depr_chapters
prepare_range(args.image_range, "image") prepare_range(args.image_range, "image")
prepare_range(args.chapter_range, "chapter") prepare_range(args.chapter_range, "chapter")
prepare_filter(args.image_filter, "image") prepare_filter(args.image_filter, "image")

View File

@@ -142,7 +142,7 @@ def build_parser():
downloader.add_argument( downloader.add_argument(
"--http-timeout", "--http-timeout",
metavar="SECONDS", action=ConfigAction, dest="timeout", type=float, metavar="SECONDS", action=ConfigAction, dest="timeout", type=float,
help="Timeout for HTTP connections (defaut: no timeout)", help="Timeout for HTTP connections (defaut: 30s)",
) )
downloader.add_argument( downloader.add_argument(
"--abort-on-skip", "--abort-on-skip",
@@ -189,17 +189,17 @@ def build_parser():
selection = parser.add_argument_group("Selection Options") selection = parser.add_argument_group("Selection Options")
selection.add_argument( selection.add_argument(
"--images", "--range",
metavar="ITEM-SPEC", dest="image_range", metavar="RANGE", dest="image_range",
help=("Specify which images to download through a comma seperated list" help=("Specify which images to download through a comma seperated list"
" of indices or index-ranges; " " of indices or index-ranges; "
"for example '--images -2,4,6-8,10-' will download images with " "for example '--images -2,4,6-8,10-' will download images with "
"index 1, 2, 4, 6, 7, 8 and 10 up to the last one"), "index 1, 2, 4, 6, 7, 8 and 10 up to the last one"),
) )
selection.add_argument( selection.add_argument(
"--chapters", "--chapter-range",
metavar="ITEM-SPEC", dest="chapter_range", metavar="RANGE", dest="chapter_range",
help="Same as '--images' except for chapters", help="Same as '--range' except for chapters and other delegated URLs",
) )
selection.add_argument( selection.add_argument(
"--filter", "--filter",
@@ -213,7 +213,15 @@ def build_parser():
selection.add_argument( selection.add_argument(
"--chapter-filter", "--chapter-filter",
metavar="EXPR", dest="chapter_filter", metavar="EXPR", dest="chapter_filter",
help="Same as '--filter' except for chapters", help="Same as '--filter' except for chapters and other delegated URLs",
)
selection.add_argument(
"--images", dest="depr_images",
help=argparse.SUPPRESS,
)
selection.add_argument(
"--chapters", dest="depr_chapters",
help=argparse.SUPPRESS,
) )
parser.add_argument( parser.add_argument(