mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
fix(bash-v2): skip empty completions when filtering descriptions (#1691)
`read` gives a last null value following a trailing newline.
Regression from fb8031162c
.
This commit is contained in:
parent
8afe9d1b56
commit
e1ded5cd94
1 changed files with 1 additions and 0 deletions
|
@ -188,6 +188,7 @@ __%[1]s_handle_standard_completion_case() {
|
||||||
local compline
|
local compline
|
||||||
# Look for the longest completion so that we can format things nicely
|
# Look for the longest completion so that we can format things nicely
|
||||||
while IFS='' read -r compline; do
|
while IFS='' read -r compline; do
|
||||||
|
[[ -z $compline ]] && continue
|
||||||
# Strip any description before checking the length
|
# Strip any description before checking the length
|
||||||
comp=${compline%%%%$tab*}
|
comp=${compline%%%%$tab*}
|
||||||
# Only consider the completions that match
|
# Only consider the completions that match
|
||||||
|
|
Loading…
Reference in a new issue