# 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
```
# Aider chat conversation:
USER: if no cmd line arg, set ARG=-r otherwise set ARG=$1
ASSISTANT: Here is the required change to set `ARG` based on the presence of a command line argument:
scripts/update-docs.sh
```bash
<<<<<<< SEARCH
# exit when any command fails
set -e
cog $ARG website/index.md
cog $ARG website/docs/usage.md
=======
# exit when any command fails
set -e
if [ -z "$1" ]; then
ARG=-r
else
ARG=$1
fi
cog $ARG website/index.md
cog $ARG website/docs/usage.md
>>>>>>> REPLACE
```
# Aider chat conversation:
USER: do we need that under the `push:` too?
ASSISTANT: Yes, we should add the `paths-ignore` condition under the `push` event as well to ensure the workflows do not run if only files in the `website/` subtree are changed.
Here are the updated *SEARCH/REPLACE* blocks:
.github/workflows/windows-tests.yml
```yaml
<<<<<<< SEARCH
pull_request:
=======
pull_request:
paths-ignore:
- 'website/**'
>>>>>>> REPLACE
```
.github/workflows/windows-tests.yml
```yaml
<<<<<<< SEARCH
push:
=======
push:
paths-ignore:
- 'website/**'
>>>>>>> REPLACE
```
.github/workflows/docker-build-test.yml
```yaml
<<<<<<< SEARCH
pull_request:
=======
pull_request:
paths-ignore:
- 'website/**'
>>>>>>> REPLACE
```
.github/workflows/docker-build-test.yml
```yaml
<<<<<<< SEARCH
push:
=======
push:
paths-ignore:
- 'website/**'
>>>>>>> REPLACE
```
.github/workflows/ubuntu-tests.yml
```yaml
<<<<<<< SEARCH
pull_request:
=======
pull_request:
paths-ignore:
- 'website/**'
>>>>>>> REPLACE
```
.github/workflows/ubuntu-tests.yml
```yaml
<<<<<<< SEARCH
push:
=======
push:
paths-ignore:
- 'website/**'
>>>>>>> REPLACE
```
# Aider chat conversation:
USER: these workflows currently run on any changes to the main branch; they don't need to run if only files in the wubsite/ subtree are changed
ASSISTANT: To ensure the workflows do not run if only files in the `website/` subtree are changed, we can add a `paths-ignore` condition to each workflow. Here are the changes:
.github/workflows/windows-tests.yml
```yaml
<<<<<<< SEARCH
pull_request:
=======
pull_request:
paths-ignore:
- 'website/**'
>>>>>>> REPLACE
```
.github/workflows/docker-build-test.yml
```yaml
<<<<<<< SEARCH
pull_request:
=======
pull_request:
paths-ignore:
- 'website/**'
>>>>>>> REPLACE
```
.github/workflows/ubuntu-tests.yml
```yaml
<<<<<<< SEARCH
pull_request:
=======
pull_request:
paths-ignore:
- 'website/**'
>>>>>>> REPLACE
```