mirror of
https://gitee.com/zhangsken/aliyunpan.git
synced 2026-10-16 10:29:42 +08:00
fix path completer empty match issue
This commit is contained in:
@@ -203,6 +203,7 @@ func main() {
|
||||
closed = strings.LastIndex(line, " ") == len(line)-1
|
||||
)
|
||||
|
||||
// 开始补全命令名称
|
||||
for _, cmd := range app.Commands {
|
||||
for _, name := range cmd.Names() {
|
||||
if !strings.HasPrefix(name, line) {
|
||||
@@ -751,6 +752,11 @@ func panFilePathCompleter(line string, lineArgs []string, numArgs int, closed bo
|
||||
s = append(s, appendLine+" ")
|
||||
continue
|
||||
}
|
||||
|
||||
// 没有命中的路径,返回当前用户输入的内容即可
|
||||
if len(s) == 0 {
|
||||
s = append(s, line)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user