diff --git a/shell-completion/hledger-completion.bash b/shell-completion/hledger-completion.bash index 855109025..2a4e1731e 100644 --- a/shell-completion/hledger-completion.bash +++ b/shell-completion/hledger-completion.bash @@ -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 diff --git a/shell-completion/hledger-completion.bash.m4 b/shell-completion/hledger-completion.bash.m4 index 892e57c9a..7a61a2a0c 100644 --- a/shell-completion/hledger-completion.bash.m4 +++ b/shell-completion/hledger-completion.bash.m4 @@ -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