From 10e38e1fe9fbae63e51ed46e602522df8f92d720 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 19 May 2023 10:55:48 -0700 Subject: [PATCH] aider: Added --verbose option to enable verbose output. # Context: USER: Add --verbose with no env default. pass into Coder and set self.verbose ASSISTANT: To add the `--verbose` option, we need to modify the `aider/main.py` file. Here's the step-by-step process: 1. Add the `--verbose` argument to the `argparse.ArgumentParser` in the `main` function. 2. Pass the `args.verbose` value to the `Coder` class when initializing it. 3. Update the `Coder` class in the `aider/coder.py` file to accept the `verbose` parameter and set `self.verbose`. Here are the changes to the code: ```python aider/main.py <<<<<<< ORIGINAL parser.add_argument( "--yes", action="store_true", help="Always say yes to every confirmation", default=False, ) ======= parser.add_argument( "--yes", action="store_true", help="Always say yes to every confirmation", default=False, ) parser.add_argument( "--verbose", action="store_true", help="Enable verbose output", default=False, ) >>>>>>> UPDATED ``` ```python aider/main.py <<<<<<< ORIGINAL coder = Coder( io, main_model=args.model, fnames=args.files, pretty=args.pretty, show_diffs=args.show_diffs, auto_commits=args.auto_commits, dry_run=args.dry_run, use_ctags=args.ctags, ) ======= coder = Coder( io, main_model=args.model, fnames=args.files, pretty=args.pretty, show_diffs=args.show_diffs, auto_commits=args.auto_commits, dry_run=args.dry_run, use_ctags=args.ctags, verbose=args.verbose, ) >>>>>>> UPDATED ``` ```python aider/coder.py <<<<<<< ORIGINAL def __init__( self, io, main_model="gpt-4", fnames=None, pretty=True, show_diffs=False, auto_commits=True, dry_run=False, use_ctags=False, ): ======= def __init__( self, io, main_model="gpt-4", fnames=None, pretty=True, show_diffs=False, auto_commits=True, dry_run=False, use_ctags=False, verbose=False, ): self.verbose = verbose >>>>>>> UPDATED ``` --- aider/coder.py | 2 ++ aider/main.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/aider/coder.py b/aider/coder.py index 699c36da9..426537f0b 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -39,7 +39,9 @@ class Coder: auto_commits=True, dry_run=False, use_ctags=False, + verbose=False, ): + self.verbose = verbose self.use_ctags = use_ctags self.abs_fnames = set() self.cur_messages = [] diff --git a/aider/main.py b/aider/main.py index 93aeb1ce8..70c2b312d 100644 --- a/aider/main.py +++ b/aider/main.py @@ -96,6 +96,12 @@ def main(args=None, input=None, output=None): help="Always say yes to every confirmation", default=False, ) + parser.add_argument( + "--verbose", + action="store_true", + help="Enable verbose output", + default=False, + ) args = parser.parse_args(args) io = InputOutput( @@ -118,6 +124,7 @@ def main(args=None, input=None, output=None): auto_commits=args.auto_commits, dry_run=args.dry_run, use_ctags=args.ctags, + verbose=args.verbose, ) if args.auto_commits: coder.commit(ask=True, prefix="wip: ", which="repo_files")