Skip to content

Commit bbbf5cf

Browse files
committed
-m shortcut for --markdown, refs #42
1 parent b62c447 commit bbbf5cf

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This will output the contents of every file, with each file preceded by its rela
6464
files-to-prompt path/to/directory --cxml
6565
```
6666

67-
- `--markdown`: Output as Markdown with fenced code blocks.
67+
- `-m/--markdown`: Output as Markdown with fenced code blocks.
6868

6969
```bash
7070
files-to-prompt path/to/directory --markdown

files_to_prompt/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ def read_paths_from_stdin(use_null_separator):
225225
help="Output in XML-ish format suitable for Claude's long context window.",
226226
)
227227
@click.option(
228+
"markdown",
229+
"-m",
228230
"--markdown",
229231
is_flag=True,
230232
help="Output Markdown with fenced code blocks",

tests/test_files_to_prompt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ def test_paths_from_arguments_and_stdin(tmpdir):
377377
assert "Contents of file2" in result.output
378378

379379

380-
def test_markdown(tmpdir):
380+
@pytest.mark.parametrize("option", ("-m", "--markdown"))
381+
def test_markdown(tmpdir, option):
381382
runner = CliRunner()
382383
with tmpdir.as_cwd():
383384
os.makedirs("test_dir")
@@ -389,7 +390,7 @@ def test_markdown(tmpdir):
389390
f.write("This is javascript")
390391
with open("test_dir/code.unknown", "w") as f:
391392
f.write("This is an unknown file type")
392-
result = runner.invoke(cli, ["test_dir", "--markdown"])
393+
result = runner.invoke(cli, ["test_dir", option])
393394
assert result.exit_code == 0
394395
actual = result.output
395396
expected = (

0 commit comments

Comments
 (0)