Commit graph

17 commits

Author SHA1 Message Date
Paul Gauthier
99c3a1ec7f feat: Rename --yes to --yes-always and update config file syntax 2024-10-02 10:55:59 -07:00
Paul Gauthier (aider)
05b3b3df88 fix: Remove f-string prefix from line without placeholders 2024-09-11 14:01:15 -07:00
Paul Gauthier
1603ffa6c2 fix: Update sample.aider.conf.yml and args_formatter.py 2024-09-11 14:01:10 -07:00
Paul Gauthier
9c9fdb0a1b Fixed sample yml file to use proper filename 2024-07-14 17:42:20 +01:00
Paul Gauthier
cd81e967f3 Added tips 2024-07-05 14:05:38 -03:00
Paul Gauthier
1a8f3ff431 copy 2024-06-18 12:58:41 -07:00
Paul Gauthier
2cb4c0d5ab Updated .env docs 2024-06-18 12:57:19 -07:00
Paul Gauthier (aider)
3c210286ba Add environment variable information to argparse help text. 2024-06-18 11:35:54 -07:00
Paul Gauthier (aider)
289ab516e9 Added DotEnvFormatter class for formatting .env help text in argparse. 2024-06-18 11:34:46 -07:00
Paul Gauthier
0fc6b9beaa copy 2024-06-14 06:16:56 -07:00
Paul Gauthier
53deb04e75 use dashed-names not underscore_names in yaml 2024-06-06 13:46:32 -07:00
Paul Gauthier
65c9a7866a improved handling of defaults 2024-06-06 13:40:16 -07:00
Paul Gauthier
645ace1d0e fix defaults in sample yml 2024-06-06 12:46:07 -07:00
Paul Gauthier
2d62e3fb1f add sample aider.conf.yml 2024-06-06 12:40:25 -07:00
Paul Gauthier
caca261587 output nice md usage 2024-06-06 12:26:06 -07:00
Paul Gauthier
8e9cbcc014 Refactored MarkdownHelpFormatter to improve formatting and display additional information about actions. 2024-06-06 12:14:20 -07:00
Paul Gauthier
e7aafd9590 aider: Add argument formatter to print arguments in a specified format.
# Aider chat conversation:

USER: Add an args formatter that prints out args like this:

## Output Settings:

### --dark-mode
Use colors suitable for a dark terminal background
Default: False

### --light-mode
Use colors suitable for a light terminal background
Default: False

...

ASSISTANT: To add an argument formatter that prints out arguments in the specified format, we need to:

1. Create a new formatter class.
2. Update the `get_help` function to use this new formatter.

Here are the changes:

1. Create a new file `aider/args_formatter.py` with the custom formatter class.
2. Update `aider/args.py` to use this new formatter.

Let's start with the new file:

aider/args_formatter.py
```python
<<<<<<< SEARCH
=======
import argparse

class CustomHelpFormatter(argparse.HelpFormatter):
    def start_section(self, heading):
        super().start_section(f"## {heading}:")

    def _format_action(self, action):
        parts = []
        if action.help:
            parts.append(f"### --{action.dest}")
            parts.append(action.help)
            if action.default is not argparse.SUPPRESS:
                parts.append(f"Default: {action.default}")
        return "\n".join(parts)

    def _format_action_invocation(self, action):
        return ""

    def _format_args(self, action, default_metavar):
        return ""
>>>>>>> REPLACE
```

Next, update `aider/args.py` to use this new formatter:

aider/args.py
```python
<<<<<<< SEARCH
from aider import __version__, models
=======
from aider import __version__, models
from aider.args_formatter import CustomHelpFormatter
>>>>>>> REPLACE
```

aider/args.py
```python
<<<<<<< SEARCH
        description="aider is GPT powered coding in your terminal",
=======
        description="aider is GPT powered coding in your terminal",
        formatter_class=CustomHelpFormatter,
>>>>>>> REPLACE
```

aider/args.py
```python
<<<<<<< SEARCH
    parser = get_parser([], None)
=======
    parser = get_parser([], None)
    parser.formatter_class = CustomHelpFormatter
>>>>>>> REPLACE
```
2024-06-06 11:38:45 -07:00