Fix a7dc62d: set $subcommandOptions unconditionally

This commit is contained in:
Vladimir Zhelezov 2020-12-14 08:10:16 +01:00
parent d82e13bb51
commit 910e86b4b2
2 changed files with 10 additions and 8 deletions

View File

@ -41,11 +41,12 @@ _hledger_completion_function() {
)"
return 0
fi
if [[ $cur == -* ]]; then
# Replace dashes with underscores and use indirect expansion
subcommandOptions=_hledger_complist_options_${subcommand//-/_}
_hledger_compreply "$(_hledger_compgen "${!subcommandOptions}")"
# Replace dashes with underscores and use indirect expansion
subcommandOptions=_hledger_complist_options_${subcommand//-/_}
if [[ $cur == -* ]]; then
_hledger_compreply "$(_hledger_compgen "${!subcommandOptions}")"
# Suspend space on completion of long options requiring an argument
[[ ${COMPREPLY[0]} == --*= ]] && compopt -o nospace

View File

@ -41,11 +41,12 @@ _hledger_completion_function() {
)"
return 0
fi
if [[ $cur == -* ]]; then
# Replace dashes with underscores and use indirect expansion
subcommandOptions=_hledger_complist_options_${subcommand//-/_}
_hledger_compreply "$(_hledger_compgen "${!subcommandOptions}")"
# Replace dashes with underscores and use indirect expansion
subcommandOptions=_hledger_complist_options_${subcommand//-/_}
if [[ $cur == -* ]]; then
_hledger_compreply "$(_hledger_compgen "${!subcommandOptions}")"
# Suspend space on completion of long options requiring an argument
[[ ${COMPREPLY[0]} == --*= ]] && compopt -o nospace