Skip to content

Commit f484794

Browse files
committed
Replace zsh END_MARKER pseudo-completion with a space to ease migration.
Document why & how this pseudo-completion is used. Signed-off-by: Ross Goldberg <[email protected]>
1 parent 383dd21 commit f484794

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/ArgumentParser/Completions/CompletionsGenerator.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ public struct CompletionShell: RawRepresentable, Hashable, CaseIterable {
102102
func format(completions: [String]) -> String {
103103
var completions = completions
104104
if self == .zsh {
105-
completions.append("END_MARKER")
105+
// This pseudo-completion is removed by the zsh completion script.
106+
// It allows trailing empty string completions to work in zsh.
107+
// zsh completion scripts generated by older SAP versions ignore spaces.
108+
completions.append(" ")
106109
}
107110
return completions.joined(separator: "\n")
108111
}

0 commit comments

Comments
 (0)