restored full --help

This commit is contained in:
Paul Gauthier 2024-06-25 06:08:43 -07:00
parent 965c35870c
commit 29905a534a
2 changed files with 22 additions and 43 deletions

View file

@ -20,42 +20,6 @@ def default_env_file(git_root):
return os.path.join(git_root, ".env") if git_root else ".env"
def get_preparser(default_config_files, git_root):
parser = configargparse.ArgumentParser(
description="aider is GPT powered coding in your terminal",
add_config_file_help=True,
default_config_files=default_config_files,
config_file_parser_class=configargparse.YAMLConfigFileParser,
auto_env_var_prefix="AIDER_",
)
add_env_file(parser, git_root)
add_config_option(parser)
return parser
def add_env_file(parser, git_root):
parser.add_argument(
"--env-file",
metavar="ENV_FILE",
default=default_env_file(git_root),
help="Specify the .env file to load (default: .env in git root)",
)
def add_config_option(parser):
parser.add_argument(
"-c",
"--config",
is_config_file=True,
metavar="CONFIG_FILE",
help=(
"Specify the config file (default: search for .aider.conf.yml in git root, cwd"
" or home directory)"
),
)
def get_parser(default_config_files, git_root):
parser = configargparse.ArgumentParser(
description="aider is GPT powered coding in your terminal",
@ -239,7 +203,12 @@ def get_parser(default_config_files, git_root):
)
# This is a duplicate of the argument in the preparser and is a no-op by this time of
# argument parsing, but it's here so that the help is displayed as expected.
add_env_file(group, git_root)
group.add_argument(
"--env-file",
metavar="ENV_FILE",
default=default_env_file(git_root),
help="Specify the .env file to load (default: .env in git root)",
)
##########
group = parser.add_argument_group("History Files")
@ -513,7 +482,16 @@ def get_parser(default_config_files, git_root):
default="utf-8",
help="Specify the encoding for input and output (default: utf-8)",
)
add_config_option(group)
group.add_argument(
"-c",
"--config",
is_config_file=True,
metavar="CONFIG_FILE",
help=(
"Specify the config file (default: search for .aider.conf.yml in git root, cwd"
" or home directory)"
),
)
group.add_argument(
"--gui",
"--browser",