fix: Update repl help and autocomplete to match implementation (#6978)

This commit is contained in:
cliffmccarthy
2025-07-06 14:05:29 -05:00
committed by GitHub
parent 7e4d4cf680
commit 9197ef04f7
2 changed files with 18 additions and 13 deletions

View File

@@ -333,8 +333,6 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
_ => println!( _ => println!(
"==========================Database commands==\n\ "==========================Database commands==\n\
info\n\ info\n\
open <file to open or create>\n\
close\n\
set <configuration-key> [<value>]\n\ set <configuration-key> [<value>]\n\
get <configuration-key>\n\ get <configuration-key>\n\
oauth2\n\ oauth2\n\
@@ -349,6 +347,8 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
==============================Chat commands==\n\ ==============================Chat commands==\n\
listchats [<query>]\n\ listchats [<query>]\n\
listarchived\n\ listarchived\n\
start-realtime <msg-id>\n\
send-realtime <msg-id> <data>\n\
chat [<chat-id>|0]\n\ chat [<chat-id>|0]\n\
createchat <contact-id>\n\ createchat <contact-id>\n\
creategroup <name>\n\ creategroup <name>\n\
@@ -364,6 +364,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
dellocations\n\ dellocations\n\
getlocations [<contact-id>]\n\ getlocations [<contact-id>]\n\
send <text>\n\ send <text>\n\
sendempty\n\
sendimage <file> [<text>]\n\ sendimage <file> [<text>]\n\
sendsticker <file> [<text>]\n\ sendsticker <file> [<text>]\n\
sendfile <file> [<text>]\n\ sendfile <file> [<text>]\n\
@@ -382,7 +383,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
unmute <chat-id>\n\ unmute <chat-id>\n\
delchat <chat-id>\n\ delchat <chat-id>\n\
accept <chat-id>\n\ accept <chat-id>\n\
decline <chat-id>\n\ blockchat <chat-id>\n\
===========================Message commands==\n\ ===========================Message commands==\n\
listmsgs <query>\n\ listmsgs <query>\n\
msginfo <msg-id>\n\ msginfo <msg-id>\n\
@@ -399,7 +400,6 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
addcontact [<name>] <addr>\n\ addcontact [<name>] <addr>\n\
contactinfo <contact-id>\n\ contactinfo <contact-id>\n\
delcontact <contact-id>\n\ delcontact <contact-id>\n\
cleanupcontacts\n\
block <contact-id>\n\ block <contact-id>\n\
unblock <contact-id>\n\ unblock <contact-id>\n\
listblocked\n\ listblocked\n\

View File

@@ -179,9 +179,11 @@ const DB_COMMANDS: [&str; 11] = [
"housekeeping", "housekeeping",
]; ];
const CHAT_COMMANDS: [&str; 36] = [ const CHAT_COMMANDS: [&str; 39] = [
"listchats", "listchats",
"listarchived", "listarchived",
"start-realtime",
"send-realtime",
"chat", "chat",
"createchat", "createchat",
"creategroup", "creategroup",
@@ -197,13 +199,16 @@ const CHAT_COMMANDS: [&str; 36] = [
"dellocations", "dellocations",
"getlocations", "getlocations",
"send", "send",
"sendempty",
"sendimage", "sendimage",
"sendsticker",
"sendfile", "sendfile",
"sendhtml", "sendhtml",
"sendsyncmsg", "sendsyncmsg",
"sendupdate", "sendupdate",
"videochat", "videochat",
"draft", "draft",
"devicemsg",
"listmedia", "listmedia",
"archive", "archive",
"unarchive", "unarchive",
@@ -211,46 +216,46 @@ const CHAT_COMMANDS: [&str; 36] = [
"unpin", "unpin",
"mute", "mute",
"unmute", "unmute",
"protect",
"unprotect",
"delchat", "delchat",
"accept", "accept",
"blockchat", "blockchat",
]; ];
const MESSAGE_COMMANDS: [&str; 9] = [ const MESSAGE_COMMANDS: [&str; 10] = [
"listmsgs", "listmsgs",
"msginfo", "msginfo",
"download",
"html",
"listfresh", "listfresh",
"forward", "forward",
"resend", "resend",
"markseen", "markseen",
"delmsg", "delmsg",
"download",
"react", "react",
]; ];
const CONTACT_COMMANDS: [&str; 8] = [ const CONTACT_COMMANDS: [&str; 7] = [
"listcontacts", "listcontacts",
"addcontact", "addcontact",
"contactinfo", "contactinfo",
"delcontact", "delcontact",
"cleanupcontacts",
"block", "block",
"unblock", "unblock",
"listblocked", "listblocked",
]; ];
const MISC_COMMANDS: [&str; 12] = [ const MISC_COMMANDS: [&str; 14] = [
"getqr", "getqr",
"getqrsvg", "getqrsvg",
"getbadqr", "getbadqr",
"checkqr", "checkqr",
"joinqr", "joinqr",
"setqr",
"createqrsvg", "createqrsvg",
"providerinfo",
"fileinfo", "fileinfo",
"estimatedeletion",
"clear", "clear",
"exit", "exit",
"quit", "quit",
"help", "help",
"estimatedeletion",
]; ];
impl Hinter for DcHelper { impl Hinter for DcHelper {