Add trailing spaces for bash completion
This commit is contained in:
parent
24c2d27eea
commit
1dce092ac0
@ -16,7 +16,11 @@ func bash_output_serializer(completions []*Completions, shell_state map[string]s
|
|||||||
for _, mg := range completions[0].Groups {
|
for _, mg := range completions[0].Groups {
|
||||||
mg.remove_common_prefix()
|
mg.remove_common_prefix()
|
||||||
for _, m := range mg.Matches {
|
for _, m := range mg.Matches {
|
||||||
fmt.Fprintln(&output, "COMPREPLY+=("+utils.QuoteStringForSH(m.Word)+")")
|
w := m.Word
|
||||||
|
if !mg.NoTrailingSpace {
|
||||||
|
w += " "
|
||||||
|
}
|
||||||
|
fmt.Fprintln(&output, "COMPREPLY+=("+utils.QuoteStringForSH(w)+")")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return []byte(output.String()), nil
|
return []byte(output.String()), nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user