From 4407ac519bd662bf973bd0509223b41a79bad7c6 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sun, 7 Apr 2024 22:32:20 -0700 Subject: [PATCH] Rename --ignore-patterns to --ignore, refs #1 I did this by hand, did not use Claude for once. --- files_to_prompt/cli.py | 3 ++- tests/test_files_to_prompt.py | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/files_to_prompt/cli.py b/files_to_prompt/cli.py index 38c8712..ef0b83a 100644 --- a/files_to_prompt/cli.py +++ b/files_to_prompt/cli.py @@ -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", diff --git a/tests/test_files_to_prompt.py b/tests/test_files_to_prompt.py index 3bf8521..4b94dd1 100644 --- a/tests/test_files_to_prompt.py +++ b/tests/test_files_to_prompt.py @@ -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