tidy the accept complete file name list config

This commit is contained in:
tickstep
2025-03-07 10:03:52 +08:00
parent 622984ee26
commit 71df114d8a
+5 -5
View File
@@ -186,12 +186,11 @@ func main() {
// tab 自动补全命令
line.State.SetCompleter(func(line string) (s []string) {
var (
lineArgs = args.Parse(line)
numArgs = len(lineArgs)
lineArgs = args.Parse(line)
numArgs = len(lineArgs)
// 支持TAB补全文件路径的命令
acceptCompleteFileCommands = []string{
"cd", "cp", "xcp", "download", "ls", "mkdir", "mv", "pwd", "rename", "rm", "share", "save", "upload", "login", "loglist", "logout",
"clear", "quit", "exit", "quota", "who", "sign", "update", "who", "su", "config",
"drive", "export", "import", "sync", "tree",
"cd", "cp", "xcp", "download", "ls", "mkdir", "mv", "rename", "rm", "upload", "tree",
}
closed = strings.LastIndex(line, " ") == len(line)-1
)
@@ -220,6 +219,7 @@ func main() {
return
}
// 检测输入的命令是否支持tab补全
if !cmdutil.ContainsString(acceptCompleteFileCommands, thisCmd.FullName()) {
return
}