From 2282dd20573dd03e231ac7a0d29e3d1fdfebd0a4 Mon Sep 17 00:00:00 2001 From: arzkar Date: Thu, 7 Oct 2021 00:12:37 +0530 Subject: [PATCH] Added info about err.log for failed downloads --- README.md | 1 + fichub_cli/cli.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cabf1fd..cc68cda 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ fichub_cli --meta-json "https://www.fanfiction.net/s/12933896/1/Things-you-canno - The fanfiction will be downloaded in epub format. To change it, use `-f` followed by the format. - The fanfiction will be downloaded in the current directory. To change it, use `-o` followed by the path to the directory. +- Failed downloads will be saved in the `err.log` file in the current directory. Check `fichub_cli --help` for more info. diff --git a/fichub_cli/cli.py b/fichub_cli/cli.py index 8068a7d..f2adcca 100644 --- a/fichub_cli/cli.py +++ b/fichub_cli/cli.py @@ -26,18 +26,24 @@ @click.option('--meta-json', 'meta_json', default=None, help='Fetch only the metadata for the fanfiction in json format.') @click.option('--log', default=False, help='Save the logfile for debugging.', is_flag=True) @click.option('-a', '--automated', default=False, help='For internal testing only.', is_flag=True, hidden=True) +@click.option('--pytest', default=False, help='To run pytest on the CLI for internal testing', is_flag=True, hidden=True) @click.option('--version', default=False, help='Display version & quit.', is_flag=True) def run_cli(infile: str, url: str, list_url: str, _format: str, get_urls: str, out_dir: str, debug: bool, version: bool, log: bool, supported_sites: bool, force: bool, automated: bool, - meta_json: str, verbose: bool): + meta_json: str, verbose: bool, pytest: bool): """ A CLI for the fichub.net API To report issues upstream for supported sites, visit https://fichub.net/#contact To report issues for the CLI, open an issue at https://github.com/FicHub/fichub-cli/issues + + Failed downloads will be saved in the `err.log` file in the current directory. """ + if pytest: # for internal testing + import pytest + pytest.main(['-v']) if log: debug = True