From ca6fcc42c80784b57a49d94b77919bf1c91aed63 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 4 Jul 2024 14:47:49 -0300 Subject: [PATCH] restored basic help --- aider/commands.py | 22 +++++++++++++++++++++- aider/help.py | 3 +++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index 440c0a179..949d7c599 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -623,8 +623,28 @@ class Commands: for file in chat_files: self.io.tool_output(f" {file}") + def basic_help(self): + commands = sorted(self.get_commands()) + pad = max(len(cmd) for cmd in commands) + pad = "{cmd:" + str(pad) + "}" + for cmd in commands: + cmd_method_name = f"cmd_{cmd[1:]}" + cmd_method = getattr(self, cmd_method_name, None) + cmd = pad.format(cmd=cmd) + if cmd_method: + description = cmd_method.__doc__ + self.io.tool_output(f"{cmd} {description}") + else: + self.io.tool_output(f"{cmd} No description available.") + self.io.tool_output() + self.io.tool_output("Use `/help ` to ask questions about how to use aider.") + def cmd_help(self, args): - "Show help about all commands" + "Ask questions about aider" + + if not args.strip(): + self.basic_help() + return from aider.coders import Coder diff --git a/aider/help.py b/aider/help.py index 566ce85da..b668a0319 100755 --- a/aider/help.py +++ b/aider/help.py @@ -39,6 +39,9 @@ def fname_to_url(filepath): docid = "" if filepath.startswith("website/_includes/"): pass + elif "HISTORY.html" in filepath: + # too much stale info + pass elif filepath.startswith(website): docid = filepath[len(website) :]