Make sure = is present in COMP_WORDBREAKS

Currently option processing logic is based on the assumption that `=` is
a word-breaking character, so make sure it is present in COMP_WORDBREAKS
This commit is contained in:
Vladimir Zhelezov 2020-12-11 12:45:31 +01:00
parent 8c14dfb3eb
commit d943fa613e
2 changed files with 10 additions and 0 deletions

View File

@ -14,8 +14,13 @@ _hledger_completion_function() {
# Current treatment for special characters:
# - exclude colon (:) from COMP_WORDBREAKS
# - option processing assumes that `=` is in COMP_WORDBREAKS
# - use comptop -o filenames to escape the rest
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
case "$COMP_WORDBREAKS" in
*=*) : ;;
*) COMP_WORDBREAKS="$COMP_WORDBREAKS=" ;;
esac
compopt -o filenames
local subcommand

View File

@ -14,8 +14,13 @@ _hledger_completion_function() {
# Current treatment for special characters:
# - exclude colon (:) from COMP_WORDBREAKS
# - option processing assumes that `=` is in COMP_WORDBREAKS
# - use comptop -o filenames to escape the rest
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
case "$COMP_WORDBREAKS" in
*=*) : ;;
*) COMP_WORDBREAKS="$COMP_WORDBREAKS=" ;;
esac
compopt -o filenames
local subcommand