mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
Merge pull request #3993 from savioursho/file-path-completion
feat: Enable file completion for all file-related arguments
This commit is contained in:
commit
ee177054b8
1 changed files with 14 additions and 14 deletions
|
@ -43,7 +43,7 @@ def get_parser(default_config_files, git_root):
|
||||||
group = parser.add_argument_group("Main model")
|
group = parser.add_argument_group("Main model")
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"files", metavar="FILE", nargs="*", help="files to edit with an LLM (optional)"
|
"files", metavar="FILE", nargs="*", help="files to edit with an LLM (optional)"
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--model",
|
"--model",
|
||||||
metavar="MODEL",
|
metavar="MODEL",
|
||||||
|
@ -110,13 +110,13 @@ def get_parser(default_config_files, git_root):
|
||||||
metavar="MODEL_SETTINGS_FILE",
|
metavar="MODEL_SETTINGS_FILE",
|
||||||
default=".aider.model.settings.yml",
|
default=".aider.model.settings.yml",
|
||||||
help="Specify a file with aider model settings for unknown models",
|
help="Specify a file with aider model settings for unknown models",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--model-metadata-file",
|
"--model-metadata-file",
|
||||||
metavar="MODEL_METADATA_FILE",
|
metavar="MODEL_METADATA_FILE",
|
||||||
default=".aider.model.metadata.json",
|
default=".aider.model.metadata.json",
|
||||||
help="Specify a file with context window and costs for unknown models",
|
help="Specify a file with context window and costs for unknown models",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--alias",
|
"--alias",
|
||||||
action="append",
|
action="append",
|
||||||
|
@ -262,13 +262,13 @@ def get_parser(default_config_files, git_root):
|
||||||
metavar="INPUT_HISTORY_FILE",
|
metavar="INPUT_HISTORY_FILE",
|
||||||
default=default_input_history_file,
|
default=default_input_history_file,
|
||||||
help=f"Specify the chat input history file (default: {default_input_history_file})",
|
help=f"Specify the chat input history file (default: {default_input_history_file})",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--chat-history-file",
|
"--chat-history-file",
|
||||||
metavar="CHAT_HISTORY_FILE",
|
metavar="CHAT_HISTORY_FILE",
|
||||||
default=default_chat_history_file,
|
default=default_chat_history_file,
|
||||||
help=f"Specify the chat history file (default: {default_chat_history_file})",
|
help=f"Specify the chat history file (default: {default_chat_history_file})",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--restore-chat-history",
|
"--restore-chat-history",
|
||||||
action=argparse.BooleanOptionalAction,
|
action=argparse.BooleanOptionalAction,
|
||||||
|
@ -280,7 +280,7 @@ def get_parser(default_config_files, git_root):
|
||||||
metavar="LLM_HISTORY_FILE",
|
metavar="LLM_HISTORY_FILE",
|
||||||
default=None,
|
default=None,
|
||||||
help="Log the conversation with the LLM to this file (for example, .aider.llm.history)",
|
help="Log the conversation with the LLM to this file (for example, .aider.llm.history)",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
|
|
||||||
##########
|
##########
|
||||||
group = parser.add_argument_group("Output settings")
|
group = parser.add_argument_group("Output settings")
|
||||||
|
@ -552,7 +552,7 @@ def get_parser(default_config_files, git_root):
|
||||||
"--analytics-log",
|
"--analytics-log",
|
||||||
metavar="ANALYTICS_LOG_FILE",
|
metavar="ANALYTICS_LOG_FILE",
|
||||||
help="Specify a file to log analytics events",
|
help="Specify a file to log analytics events",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--analytics-disable",
|
"--analytics-disable",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
|
@ -619,7 +619,7 @@ def get_parser(default_config_files, git_root):
|
||||||
"Specify a file containing the message to send the LLM, process reply, then exit"
|
"Specify a file containing the message to send the LLM, process reply, then exit"
|
||||||
" (disables chat mode)"
|
" (disables chat mode)"
|
||||||
),
|
),
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--gui",
|
"--gui",
|
||||||
"--browser",
|
"--browser",
|
||||||
|
@ -637,7 +637,7 @@ def get_parser(default_config_files, git_root):
|
||||||
"--apply",
|
"--apply",
|
||||||
metavar="FILE",
|
metavar="FILE",
|
||||||
help="Apply the changes from the given file instead of running the chat (debug)",
|
help="Apply the changes from the given file instead of running the chat (debug)",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--apply-clipboard-edits",
|
"--apply-clipboard-edits",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
|
@ -698,13 +698,13 @@ def get_parser(default_config_files, git_root):
|
||||||
action="append",
|
action="append",
|
||||||
metavar="FILE",
|
metavar="FILE",
|
||||||
help="specify a file to edit (can be used multiple times)",
|
help="specify a file to edit (can be used multiple times)",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--read",
|
"--read",
|
||||||
action="append",
|
action="append",
|
||||||
metavar="FILE",
|
metavar="FILE",
|
||||||
help="specify a read-only file (can be used multiple times)",
|
help="specify a read-only file (can be used multiple times)",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--vim",
|
"--vim",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
|
@ -734,7 +734,7 @@ def get_parser(default_config_files, git_root):
|
||||||
"--load",
|
"--load",
|
||||||
metavar="LOAD_FILE",
|
metavar="LOAD_FILE",
|
||||||
help="Load and execute /commands from a file on launch",
|
help="Load and execute /commands from a file on launch",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--encoding",
|
"--encoding",
|
||||||
default="utf-8",
|
default="utf-8",
|
||||||
|
@ -755,7 +755,7 @@ def get_parser(default_config_files, git_root):
|
||||||
"Specify the config file (default: search for .aider.conf.yml in git root, cwd"
|
"Specify the config file (default: search for .aider.conf.yml in git root, cwd"
|
||||||
" or home directory)"
|
" or home directory)"
|
||||||
),
|
),
|
||||||
)
|
).complete = shtab.FILE
|
||||||
# This is a duplicate of the argument in the preparser and is a no-op by this time of
|
# 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.
|
# argument parsing, but it's here so that the help is displayed as expected.
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
|
@ -763,7 +763,7 @@ def get_parser(default_config_files, git_root):
|
||||||
metavar="ENV_FILE",
|
metavar="ENV_FILE",
|
||||||
default=default_env_file(git_root),
|
default=default_env_file(git_root),
|
||||||
help="Specify the .env file to load (default: .env in git root)",
|
help="Specify the .env file to load (default: .env in git root)",
|
||||||
)
|
).complete = shtab.FILE
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--suggest-shell-commands",
|
"--suggest-shell-commands",
|
||||||
action=argparse.BooleanOptionalAction,
|
action=argparse.BooleanOptionalAction,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue