From d943fa613efaba2ed54801f4744e60c039b10d82 Mon Sep 17 00:00:00 2001 From: Vladimir Zhelezov Date: Fri, 11 Dec 2020 12:45:31 +0100 Subject: [PATCH] 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 --- shell-completion/hledger-completion.bash | 5 +++++ shell-completion/hledger-completion.bash.m4 | 5 +++++ 2 files changed, 10 insertions(+) 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