Rename --ignore-patterns to --ignore, refs #1

I did this by hand, did not use Claude for once.
This commit is contained in:
Simon Willison
2024-04-07 22:32:20 -07:00
parent f8af0fad7f
commit 4407ac519b
2 changed files with 4 additions and 5 deletions

View File

@@ -85,7 +85,8 @@ def process_path(
help="Ignore .gitignore files and include all files",
)
@click.option(
"--ignore-patterns",
"ignore_patterns",
"--ignore",
multiple=True,
default=[],
help="List of patterns to ignore",

View File

@@ -91,15 +91,13 @@ def test_ignore_patterns(tmpdir):
with open("test_dir/file_to_include.txt", "w") as f:
f.write("This file should be included")
result = runner.invoke(cli, ["test_dir", "--ignore-patterns", "*.txt"])
result = runner.invoke(cli, ["test_dir", "--ignore", "*.txt"])
assert result.exit_code == 0
assert "test_dir/file_to_ignore.txt" not in result.output
assert "This file should be ignored due to ignore patterns" not in result.output
assert "test_dir/file_to_include.txt" not in result.output
result = runner.invoke(
cli, ["test_dir", "--ignore-patterns", "file_to_ignore.*"]
)
result = runner.invoke(cli, ["test_dir", "--ignore", "file_to_ignore.*"])
assert result.exit_code == 0
assert "test_dir/file_to_ignore.txt" not in result.output
assert "This file should be ignored due to ignore patterns" not in result.output