Update hledger completion
There have been some changes in the last four years. I included what seemed to me the most important commands and parameters.
This commit is contained in:
parent
e1273aa5b5
commit
c66a6b1c27
21
src/_hledger
21
src/_hledger
|
@ -16,14 +16,15 @@
|
||||||
# Description
|
# Description
|
||||||
# -----------
|
# -----------
|
||||||
#
|
#
|
||||||
# Completion script for hleder 0.23.2 ( http://hledger.org/ )
|
# Completion script for hleder 1.10 ( http://hledger.org/ )
|
||||||
# Last updated: 16.11.2014
|
# Last updated: 29.07.2018
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Authors
|
# Authors
|
||||||
# -------
|
# -------
|
||||||
#
|
#
|
||||||
# * Valodim ( https://github.com/Valodim )
|
# * Valodim ( https://github.com/Valodim )
|
||||||
|
# * fdw ( https://github.com/fdw )
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Notes
|
# Notes
|
||||||
|
@ -43,6 +44,7 @@ args=(
|
||||||
'(-f --file)'{-f,--file}'=[use a different input file]:input file:_files'
|
'(-f --file)'{-f,--file}'=[use a different input file]:input file:_files'
|
||||||
'--rules-file=[CSV conversion rules file]:rules file:_files'
|
'--rules-file=[CSV conversion rules file]:rules file:_files'
|
||||||
'--alias=[display accounts named OLD as NEW]:alias specification'
|
'--alias=[display accounts named OLD as NEW]:alias specification'
|
||||||
|
'--anon=[anonymize accounts and payees'
|
||||||
'(-b --begin)'{-b,--begin}'=[include postings/txns on or after this date]:date'
|
'(-b --begin)'{-b,--begin}'=[include postings/txns on or after this date]:date'
|
||||||
'(-e --end)'{-e,--end}'=[include postings/txns before this date]:date'
|
'(-e --end)'{-e,--end}'=[include postings/txns before this date]:date'
|
||||||
'(-D --daily)'{-D,--daily}'[multiperiod/multicolumn report by day]'
|
'(-D --daily)'{-D,--daily}'[multiperiod/multicolumn report by day]'
|
||||||
|
@ -57,6 +59,9 @@ args=(
|
||||||
'(--depth)--depth=[hide accounts/postings deeper than N]:depth'
|
'(--depth)--depth=[hide accounts/postings deeper than N]:depth'
|
||||||
'(-E --empty)'{-E,--empty}'[show empty/zero things which are normally omitted]'
|
'(-E --empty)'{-E,--empty}'[show empty/zero things which are normally omitted]'
|
||||||
'(-B --cost)'{-B,--cost}'[show amounts in their cost price'\''s commodity]'
|
'(-B --cost)'{-B,--cost}'[show amounts in their cost price'\''s commodity]'
|
||||||
|
'(-V --value)'{-V,--value}'[converts reported amounts to the current market value]'
|
||||||
|
'(-I --ignore-assertions'{-I,--ignore-assertions}'[ignore any failing balance assertions]'
|
||||||
|
'--forecast=[apply periodic transaction rules to generate future transactions]'
|
||||||
)
|
)
|
||||||
|
|
||||||
_arguments -C "$args[@]" -A "-*" \
|
_arguments -C "$args[@]" -A "-*" \
|
||||||
|
@ -72,15 +77,19 @@ while (( $#state )); do
|
||||||
cmds)
|
cmds)
|
||||||
typeset -a cmds
|
typeset -a cmds
|
||||||
cmds=(
|
cmds=(
|
||||||
'print:show transaction entries'
|
'print:show transaction entries (p, txns)'
|
||||||
'accounts:show account names'
|
'accounts:show account names'
|
||||||
'balance:show accounts and balances (bal)'
|
'balance:show accounts and balances (b, bal)'
|
||||||
'register:show postings and running total (reg)'
|
'register:show postings and running total (r, reg)'
|
||||||
'incomestatement:show an income statement (is)'
|
'incomestatement:show an income statement (is)'
|
||||||
'balancesheet:show a balance sheet (bs)'
|
'balancesheet:show a balance sheet (bs)'
|
||||||
'cashflow:show a cashflow statement (cf)'
|
'cashflow:show a cashflow statement (cf)'
|
||||||
'activity:show an ascii barchart of posting counts per interval'
|
'activity:show an ascii barchart of posting counts per interval'
|
||||||
'stats:show some journal statistics'
|
'stats:show some journal statistics'
|
||||||
|
'add:prompt for transactions and add them to the journal'
|
||||||
|
'close:print closing/opening transactions that bring some or all account balances to zero and back'
|
||||||
|
'stats:show some journal statistics'
|
||||||
|
'tags:list all the tag names used in the journal'
|
||||||
)
|
)
|
||||||
_describe 'subcommands' cmds && ret=0
|
_describe 'subcommands' cmds && ret=0
|
||||||
;;
|
;;
|
||||||
|
@ -141,6 +150,7 @@ while (( $#state )); do
|
||||||
|
|
||||||
local -a accs keywords
|
local -a accs keywords
|
||||||
keywords=(
|
keywords=(
|
||||||
|
'acct\::match account names'
|
||||||
'code\::match by transaction code'
|
'code\::match by transaction code'
|
||||||
'desc\::match transaction descriptions'
|
'desc\::match transaction descriptions'
|
||||||
'tag\::match by tag name'
|
'tag\::match by tag name'
|
||||||
|
@ -149,6 +159,7 @@ while (( $#state )); do
|
||||||
'real\::match real/virtual transactions'
|
'real\::match real/virtual transactions'
|
||||||
'empty\::match if amount is/is not zero'
|
'empty\::match if amount is/is not zero'
|
||||||
'amt\::match transaction amount'
|
'amt\::match transaction amount'
|
||||||
|
'cur\::match by currency'
|
||||||
)
|
)
|
||||||
if compset -P 'amt:'; then
|
if compset -P 'amt:'; then
|
||||||
_message 'match amount (<, <=, >, >=, add sign for non-absolute match)' && ret=0
|
_message 'match amount (<, <=, >, >=, add sign for non-absolute match)' && ret=0
|
||||||
|
|
Loading…
Reference in New Issue