Fix _hledger_extension_completion when called by path...
Could break if called with ./funky-path/with-dashes/hledger-ui
This commit is contained in:
parent
fb3577d3e0
commit
fdac46d68a
@ -117,9 +117,11 @@ _hledger_completion_function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_hledger_extension_completion_function() {
|
_hledger_extension_completion_function() {
|
||||||
# Pretend that hledger is called with given extension
|
local cmd=${1##*/}
|
||||||
# as first argument and call main completion function
|
local ext=${cmd#hledger-}
|
||||||
COMP_WORDS=("hledger" "${1#*-}" "${COMP_WORDS[@]:1}")
|
# Pretend that hledger is called with the given extension
|
||||||
|
# as the first argument and call main completion function
|
||||||
|
COMP_WORDS=("hledger" "$ext" "${COMP_WORDS[@]:1}")
|
||||||
COMP_CWORD=$((COMP_CWORD + 1))
|
COMP_CWORD=$((COMP_CWORD + 1))
|
||||||
_hledger_completion_function "hledger" "${@:1}"
|
_hledger_completion_function "hledger" "${@:1}"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,9 +117,11 @@ _hledger_completion_function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_hledger_extension_completion_function() {
|
_hledger_extension_completion_function() {
|
||||||
# Pretend that hledger is called with given extension
|
local cmd=${1##*/}
|
||||||
# as first argument and call main completion function
|
local ext=${cmd#hledger-}
|
||||||
COMP_WORDS=("hledger" "${1#*-}" "${COMP_WORDS[@]:1}")
|
# Pretend that hledger is called with the given extension
|
||||||
|
# as the first argument and call main completion function
|
||||||
|
COMP_WORDS=("hledger" "$ext" "${COMP_WORDS[@]:1}")
|
||||||
COMP_CWORD=$((COMP_CWORD + 1))
|
COMP_CWORD=$((COMP_CWORD + 1))
|
||||||
_hledger_completion_function "hledger" "${@:1}"
|
_hledger_completion_function "hledger" "${@:1}"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user