mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 21:34:59 +00:00
![]() # Aider chat conversation: USER: if no files are provided on cmd line, do git ls-files and filter to python files ASSISTANT: To implement the requested change, we need to modify the `main` function to use `git ls-files` to list all files in the repository and filter them to include only Python files if no filenames are provided on the command line. Here is the *SEARCH/REPLACE* block: ```python scripts/blame.py ```python <<<<<<< SEARCH if len(sys.argv) < 2: print(f"Usage: {sys.argv[0]} <filename> ...") sys.exit(1) ======= if len(sys.argv) < 2: result = subprocess.run( ["git", "ls-files"], capture_output=True, text=True, check=True ) fnames = [fname for fname in result.stdout.splitlines() if fname.endswith('.py')] if not fnames: print("No Python files found in the repository.") sys.exit(1) else: fnames = sys.argv[1:] >>>>>>> REPLACE ``` This change ensures that if no filenames are provided on the command line, the script will list all files in the repository, filter them to include only Python files, and then process those files. |
||
---|---|---|
.. | ||
blame.py | ||
Dockerfile.jekyll | ||
jekyll_build.sh | ||
jekyll_run.sh | ||
versionbump.py |