diff options
| author | Cody Logan <clpo13@gmail.com> | 2020-01-06 16:28:58 -0800 |
|---|---|---|
| committer | Cody Logan <clpo13@gmail.com> | 2020-01-06 16:28:58 -0800 |
| commit | b6d58f4aecf452eb46d0e2190f56b512fb717e8d (patch) | |
| tree | 647a1cca5e407ae5100718de536263a239b5e58f /wikiget | |
| parent | 00d00b37c973281ff2677d99a3d612ac87b11931 (diff) | |
| download | wikiget-b6d58f4aecf452eb46d0e2190f56b512fb717e8d.tar.gz wikiget-b6d58f4aecf452eb46d0e2190f56b512fb717e8d.zip | |
Prevent unintended behavior when combining -o and -a
When batch downloading files with -a, specifying an output name
with -o will result in only the first file being downloaded. If
-f is also given, then only the last file is kept (with the previous
ones being overwritten). This is not ideal behavior, so the ability
to specify an output filename has been disabled when running wikiget
in batch mode.
In the future, -o could be used as a template string or prefix when
in batch mode, along the lines of what youtube-dl does.
Diffstat (limited to 'wikiget')
| -rw-r--r-- | wikiget/wikiget.py | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/wikiget/wikiget.py b/wikiget/wikiget.py index d272f96..566448f 100644 --- a/wikiget/wikiget.py +++ b/wikiget/wikiget.py @@ -63,25 +63,27 @@ def main(): """) parser.add_argument('-V', '--version', action='version', version='%(prog)s {}'.format(__version__)) - output_options = parser.add_mutually_exclusive_group() - output_options.add_argument('-q', '--quiet', - help='suppress warning messages', - action='store_true') - output_options.add_argument('-v', '--verbose', - help='print detailed information; ' - 'use -vv for even more detail', - action='count', default=0) + message_options = parser.add_mutually_exclusive_group() + message_options.add_argument('-q', '--quiet', + help='suppress warning messages', + action='store_true') + message_options.add_argument('-v', '--verbose', + help='print detailed information; ' + 'use -vv for even more detail', + action='count', default=0) parser.add_argument('-f', '--force', help='force overwriting existing files', action='store_true') parser.add_argument('-s', '--site', default=DEFAULT_SITE, help='MediaWiki site to download from ' '(default: %(default)s)') - parser.add_argument('-o', '--output', help='write download to OUTPUT') - parser.add_argument('-a', '--batch', - help='treat FILE as a textfile containing multiple ' - 'files to download, one URL or filename per line', - action='store_true') + output_options = parser.add_mutually_exclusive_group() + output_options.add_argument('-o', '--output', + help='write download to OUTPUT') + output_options.add_argument('-a', '--batch', + help='treat FILE as a textfile containing ' + 'multiple files to download, one URL or ' + 'filename per line', action='store_true') args = parser.parse_args() |
