# 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
```