Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files_to_prompt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def cli(
markdown,
line_numbers,
)
if claude_xml:
if claude_xml and paths:
writer("</documents>")
if fp:
fp.close()
12 changes: 12 additions & 0 deletions tests/test_files_to_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,18 @@ def test_paths_from_arguments_and_stdin(tmpdir):
assert "test_dir2/file2.txt" in result.output
assert "Contents of file2" in result.output

def test_empty_path_set(tmpdir):
runner = CliRunner()
with tmpdir.as_cwd():
# Test empty path set
result = runner.invoke(
cli,
args=["-c"],
input="",
)
assert result.exit_code == 0
assert "" == result.output


@pytest.mark.parametrize("option", ("-m", "--markdown"))
def test_markdown(tmpdir, option):
Expand Down