Skip to content

Commit 9bfda44

Browse files
committed
fix #74 again
1 parent cb81d71 commit 9bfda44

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

shtab/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,11 @@ def complete_bash(parser, root_prefix=None, preamble="", choice_functions=None):
420420
COMPREPLY=( $(compgen -W "${current_option_strings[*]}" -- "${completing_word}") )
421421
else
422422
# use choices & compgen
423-
COMPREPLY=( $(compgen -W "${current_action_choices[*]}" -- "${completing_word}") \\
424-
$([ -n "${current_action_compgen}" ] \\
423+
local IFS=$'\\n' # items may contain spaces, so delimit using newline
424+
COMPREPLY=( $([ -n "${current_action_compgen}" ] \\
425425
&& "${current_action_compgen}" "${completing_word}") )
426+
unset IFS
427+
COMPREPLY+=( $(compgen -W "${current_action_choices[*]}" -- "${completing_word}") )
426428
fi
427429

428430
return 0

0 commit comments

Comments
 (0)