Add tab-completion for 'help' command in interactive mode

This commit is contained in:
Greg Neagle
2025-06-03 11:59:31 -07:00
parent 6a40cc8010
commit 0fa92d7390

View File

@@ -48,7 +48,7 @@ class TabCompleter {
"delete-manifest": ["manifests"],
// "refresh-cache": [],
"exit": [],
"help": [],
"help": ["commands"],
"configure": [],
"version": [],
]
@@ -152,6 +152,9 @@ class TabCompleter {
case "manifests":
let wordList = manifests + options.dropFirst() + ["--help"]
return wordList.filter { $0.hasPrefix(text) }
case "commands":
let wordList = Array(commands.keys) + options.dropFirst() + ["--help"]
return wordList.filter { $0.hasPrefix(text) }
default:
let wordList = options + ["--help"]
return wordList.filter { $0.hasPrefix(text) }