mirror of
https://github.com/simonmichael/hledger.git
synced 2025-01-07 11:19:32 +03:00
Query filter completion for amt, real and status; clean whitespace
This commit is contained in:
parent
812a525acf
commit
31f7a32e36
@ -228,29 +228,24 @@ _hledger_compreply_query() {
|
||||
|
||||
local hledgerArgs=()
|
||||
case $query in
|
||||
acct:)
|
||||
hledgerArgs=(accounts --flat)
|
||||
;;
|
||||
code:)
|
||||
hledgerArgs=(codes)
|
||||
;;
|
||||
cur:)
|
||||
hledgerArgs=(commodities)
|
||||
;;
|
||||
desc:)
|
||||
hledgerArgs=(descriptions)
|
||||
;;
|
||||
note:)
|
||||
hledgerArgs=(notes)
|
||||
;;
|
||||
payee:)
|
||||
hledgerArgs=(payees)
|
||||
;;
|
||||
tag:)
|
||||
hledgerArgs=(tags)
|
||||
;;
|
||||
acct:) hledgerArgs=(accounts --flat) ;;
|
||||
code:) hledgerArgs=(codes) ;;
|
||||
cur:) hledgerArgs=(commodities) ;;
|
||||
desc:) hledgerArgs=(descriptions) ;;
|
||||
note:) hledgerArgs=(notes) ;;
|
||||
payee:) hledgerArgs=(payees) ;;
|
||||
tag:) hledgerArgs=(tags) ;;
|
||||
*)
|
||||
return 1
|
||||
local wordlist
|
||||
case $query in
|
||||
amt:) wordlist="< <= > >=" ;;
|
||||
real:) wordlist="\ 0" ;;
|
||||
status:) wordlist="\ * !" ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
_get_comp_words_by_ref -n '<=>' -c wordToComplete
|
||||
_hledger_compreply "$(compgen -P "$query" -W "$wordlist" -- "${wordToComplete#*:}")"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -228,29 +228,24 @@ _hledger_compreply_query() {
|
||||
|
||||
local hledgerArgs=()
|
||||
case $query in
|
||||
acct:)
|
||||
hledgerArgs=(accounts --flat)
|
||||
;;
|
||||
code:)
|
||||
hledgerArgs=(codes)
|
||||
;;
|
||||
cur:)
|
||||
hledgerArgs=(commodities)
|
||||
;;
|
||||
desc:)
|
||||
hledgerArgs=(descriptions)
|
||||
;;
|
||||
note:)
|
||||
hledgerArgs=(notes)
|
||||
;;
|
||||
payee:)
|
||||
hledgerArgs=(payees)
|
||||
;;
|
||||
tag:)
|
||||
hledgerArgs=(tags)
|
||||
;;
|
||||
acct:) hledgerArgs=(accounts --flat) ;;
|
||||
code:) hledgerArgs=(codes) ;;
|
||||
cur:) hledgerArgs=(commodities) ;;
|
||||
desc:) hledgerArgs=(descriptions) ;;
|
||||
note:) hledgerArgs=(notes) ;;
|
||||
payee:) hledgerArgs=(payees) ;;
|
||||
tag:) hledgerArgs=(tags) ;;
|
||||
*)
|
||||
return 1
|
||||
local wordlist
|
||||
case $query in
|
||||
amt:) wordlist="< <= > >=" ;;
|
||||
real:) wordlist="\ 0" ;;
|
||||
status:) wordlist="\ * !" ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
_get_comp_words_by_ref -n '<=>' -c wordToComplete
|
||||
_hledger_compreply "$(compgen -P "$query" -W "$wordlist" -- "${wordToComplete#*:}")"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user