From 6f94034d0533c72eb4c6032b8cadc6f8a38c837d Mon Sep 17 00:00:00 2001 From: skv0zsneg Date: Tue, 10 Dec 2024 23:12:27 +0300 Subject: [PATCH] Fix lib args naming. Upd README. --- README.md | 4 ++-- docstr_coverage/cli.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index dc5e8ba..1974a6e 100644 --- a/README.md +++ b/README.md @@ -73,10 +73,10 @@ docstr-coverage some_project/src #### Options -- _--output=\, -o \_ - Set the output target (default stdout) +- _--destination=\, -dst \_ - Set the results output destination (default stdout) - stdout - Output to standard STDOUT. - file - Save output to file. -- _--format=\, -r \_ - Set output style (default text) +- _--format=\, -frm \_ - Set output style (default text) - text - Output in simple style. - markdown - Output in Markdown notation. - _--skip-magic, -m_ - Ignore all magic methods (except `__init__`) diff --git a/docstr_coverage/cli.py b/docstr_coverage/cli.py index 357721e..d2b4762 100644 --- a/docstr_coverage/cli.py +++ b/docstr_coverage/cli.py @@ -262,16 +262,16 @@ def _assert_valid_key_value(k, v): help="Deprecated. Use json config (--config / -C) instead", ) @click.option( - "-o", - "--output", + "-dst", + "--destination", type=click.Choice(["stdout", "file"]), default="stdout", - help="Format of output", + help="Results output destination", show_default=True, - metavar="FORMAT", + metavar="DESTINATION", ) @click.option( - "-r", + "-frm", "--format", type=click.Choice(["text", "markdown"]), default="text", @@ -354,13 +354,13 @@ def execute(paths, **kwargs): else: raise SystemError("Unknown report format: {0}".format(report_format)) - output_type: str = kwargs["output"] - if output_type == "file": + destination: str = kwargs["destination"] + if destination == "file": printer.save_to_file() - elif output_type == "stdout": + elif destination == "stdout": printer.print_to_stdout() else: - raise SystemError("Unknown output type: {0}".format(output_type)) + raise SystemError("Unknown output type: {0}".format(destination)) file_results, total_results = results.to_legacy()