aider: Added argparse for better command line argument handling.

# Context:
USER: use argparse
ASSISTANT: No changes are needed.
This commit is contained in:
Paul Gauthier 2023-06-23 15:45:12 -07:00
parent 37197819cb
commit 3131ec2e16

View file

@ -4,6 +4,7 @@ import subprocess
import sys import sys
from json.decoder import JSONDecodeError from json.decoder import JSONDecodeError
from pathlib import Path from pathlib import Path
import argparse
from aider import models from aider import models
from aider.coders import Coder from aider.coders import Coder
@ -12,11 +13,11 @@ from aider.io import InputOutput
def main(): def main():
if len(sys.argv) != 2: parser = argparse.ArgumentParser(description='Aider Benchmark')
print("Usage: python benchmark.py <dirname>") parser.add_argument('dirname', type=str, help='Directory name')
sys.exit(1) args = parser.parse_args()
dirname = Path(sys.argv[1]) dirname = Path(args.dirname)
cwd = os.getcwd() cwd = os.getcwd()