This commit is contained in:
Paul Gauthier 2023-07-05 21:33:59 -07:00
parent d97bf17e19
commit 09605788d5

View file

@ -1,9 +1,9 @@
import glob
import json
import os
import shlex
import subprocess
import sys
import glob
import git
import tiktoken
@ -11,6 +11,7 @@ from prompt_toolkit.completion import Completion
from aider import prompts, utils
class Commands:
def __init__(self, io, coder):
self.io = io
@ -216,14 +217,12 @@ class Commands:
if partial.lower() in fname.lower():
yield Completion(fname, start_position=-len(partial))
import glob
def cmd_add(self, args):
"Add matching files to the chat session using glob patterns"
added_fnames = []
for pattern in args.split():
matched_files = glob.glob(pattern, recursive=True)
for word in args.split():
matched_files = glob.glob(word, recursive=True)
if not matched_files:
if self.coder.repo is not None: