Skip to content

Commit

Permalink
Fix lib args naming. Upd README.
Browse files Browse the repository at this point in the history
  • Loading branch information
skv0zsneg committed Dec 10, 2024
1 parent d321905 commit 6f94034
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ docstr-coverage some_project/src

#### Options

- _--output=\<type\>, -o \<type\>_ - Set the output target (default stdout)
- _--destination=\<type\>, -dst \<type\>_ - Set the results output destination (default stdout)
- stdout - Output to standard STDOUT.
- file - Save output to file.
- _--format=\<type\>, -r \<type\>_ - Set output style (default text)
- _--format=\<type\>, -frm \<type\>_ - Set output style (default text)
- text - Output in simple style.
- markdown - Output in Markdown notation.
- _--skip-magic, -m_ - Ignore all magic methods (except `__init__`)
Expand Down
18 changes: 9 additions & 9 deletions docstr_coverage/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 6f94034

Please sign in to comment.