add -d/--directory and -f/--filename command-line arguments
This commit is contained in:
@@ -115,6 +115,13 @@ def main():
|
||||
config.load(args.cfgfiles, strict=True)
|
||||
if args.yamlfiles:
|
||||
config.load(args.yamlfiles, strict=True, fmt="yaml")
|
||||
if args.filename:
|
||||
if args.filename == "/O":
|
||||
args.filename = "{filename}.{extension}"
|
||||
config.set((), "filename", args.filename)
|
||||
if args.directory:
|
||||
config.set((), "base-directory", args.directory)
|
||||
config.set((), "directory", ())
|
||||
if args.postprocessors:
|
||||
config.set((), "postprocessors", args.postprocessors)
|
||||
if args.abort:
|
||||
|
||||
@@ -92,9 +92,9 @@ def build_parser():
|
||||
help="Print program version and exit",
|
||||
)
|
||||
general.add_argument(
|
||||
"-d", "--dest",
|
||||
"--dest",
|
||||
dest="base-directory", metavar="DEST", action=ConfigAction,
|
||||
help="Destination directory",
|
||||
help=argparse.SUPPRESS,
|
||||
)
|
||||
general.add_argument(
|
||||
"-i", "--input-file",
|
||||
@@ -102,6 +102,17 @@ def build_parser():
|
||||
help=("Download URLs found in FILE ('-' for stdin). "
|
||||
"More than one --input-file can be specified"),
|
||||
)
|
||||
general.add_argument(
|
||||
"-f", "--filename",
|
||||
dest="filename", metavar="FORMAT",
|
||||
help=("Filename format string for downloaded files "
|
||||
"('/O' for \"original\" filenames)"),
|
||||
)
|
||||
general.add_argument(
|
||||
"-d", "--directory",
|
||||
dest="directory", metavar="PATH",
|
||||
help="Target location for file downloads",
|
||||
)
|
||||
general.add_argument(
|
||||
"--cookies",
|
||||
dest="cookies", metavar="FILE", action=ConfigAction,
|
||||
|
||||
Reference in New Issue
Block a user