Skip to content

Commit eaab432

Browse files
committed
refactor: Print help and duties when no arguments are given
Issue #11: #11
1 parent b4e24ec commit eaab432

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/duty/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def main(args: list[str] | None = None) -> int:
262262
return 1
263263

264264
if not arg_lists:
265-
print("> Please choose at least one duty", file=sys.stderr)
265+
print_help(parser, opts, collection)
266266
return 1
267267

268268
global_opts = specified_options(opts, exclude={"duties_file", "list", "help", "remainder"})

Diff for: tests/test_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_no_duty(capsys: pytest.CaptureFixture) -> None:
1515
"""
1616
assert cli.main([]) == 1
1717
captured = capsys.readouterr()
18-
assert "choose at least one duty" in captured.err
18+
assert "Available duties" in captured.out
1919

2020

2121
def test_show_help(capsys: pytest.CaptureFixture) -> None:

0 commit comments

Comments
 (0)