From 0d641ad2b9dc89d62687b2ab1b11f9164da4e2d4 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 6 Jul 2023 08:36:16 -1000 Subject: [PATCH] ;doc:bin:tt: updates --- bin/README.md | 38 ++++++++++++++++++++------------------ bin/tt | 26 ++++++++++++++------------ 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/bin/README.md b/bin/README.md index e0ac53fb7..1b1bbaea8 100644 --- a/bin/README.md +++ b/bin/README.md @@ -109,24 +109,26 @@ $ t tt - time tool: run time reports and time-related scripts Usage: tt [COMMAND [ARGS]] Commands: -help show this help -dash show time dashboard, redisplaying when timelog files change -status show current time status -what what happened ? Show largest balances first, today and depth 1 by default -dots print line of N dots, grouped in 4s (suitable for timedot) -x horizontal time summary this year, monthly by default -y vertical time summary this year, monthly by default -rweeks recent weeks' time budgets -weeks this and last week's time budgets -unused unused & undeclared account names -unusedcat unused & undeclared account names by category -budgets show monthly time budget performance this year -budgetsy show monthly time budget performance this year, vertically -budgetsw show weekly time budget performance this year -budgetswx show weekly time budget performance this year, horizontally -addacc add declarations for all undeclared accounts -hours show a bar chart of daily hours -OTHERCMD [ARGS] run other hledger commands on $TIMELOG +help show this help +dash show time dashboard, redisplaying when timelog files change +status show current time status +what what happened ? Show largest balances first, today and depth 1 by default +dots print line of N dots, grouped in 4s (suitable for timedot) +x horizontal time summary this year, monthly by default +y vertical time summary this year, monthly by default +rweeks recent weeks' time budgets +weeks this and last week's time budgets +hours show a bar chart of daily hours +accunused show unused / undeclared accounts +accunusedcat show unused / undeclared accounts by category +accadd add declarations for all undeclared accounts +budgets show monthly time budget performance this year +budgetsy show monthly time budget performance this year, vertically +budgetsw show weekly time budget performance this year +budgetswx show weekly time budget performance this year, horizontally +OTHERCMD [ARGS] run other hledger commands on $TIMELOG + +Add hledger options to customise reports. ``` ### watchaccounts diff --git a/bin/tt b/bin/tt index 9bca5d60a..e7ffdc0fa 100755 --- a/bin/tt +++ b/bin/tt @@ -24,7 +24,9 @@ tt - time tool: run time reports and time-related scripts Usage: tt [COMMAND [ARGS]] Commands: $($rg '^\w.*\(\) *\{ *#' "$0" | $sed -e 's/() *{//' | column -t -s'#') -OTHERCMD [ARGS] run other hledger commands on \$TIMELOG +OTHERCMD [ARGS] run other hledger commands on \$TIMELOG + +Add hledger options to customise reports. EOF } @@ -128,7 +130,11 @@ weeks() { # this and last week's time budgets timeweekly run } -unused() { # unused & undeclared account names +hours() { # show a bar chart of daily hours + hledger-bar -v 1 -f "$TIMELOG" -D "$@" +} + +accunused() { # show unused / undeclared accounts echo "Unused: (but declared)" hledger -f "$TIMELOG" acc --unused "$@" --directives | gsed -E 's/:(.)/.\1/g' echo @@ -136,10 +142,15 @@ unused() { # unused & undeclared account names hledger -f "$TIMELOG" acc --undeclared "$@" --directives | gsed -E 's/:(.)/.\1/g' } -unusedcat() { # unused & undeclared account names by category +accunusedcat() { # show unused / undeclared accounts by category for a in $(tt acc -1); do line; echo "$a":; tt unused "^$a"; echo; done; line } +accadd() { # add declarations for all undeclared accounts + # shellcheck disable=SC2094 + hledger -f "$TIMELOG" accounts --undeclared --directives | sed 's/:/./g' >>"$TIMELOG" +} + # Budget reports. cf status() budgets() { # show monthly time budget performance this year @@ -162,15 +173,6 @@ budgetswx() { # show weekly time budget performance this year, horizontally x --budget=daily -W -p 3/27..tomorrow "$@" } -addacc() { # add declarations for all undeclared accounts - # shellcheck disable=SC2094 - hledger -f "$TIMELOG" accounts --undeclared --directives | sed 's/:/./g' >>"$TIMELOG" -} - -hours() { # show a bar chart of daily hours - hledger-bar -v 1 -f "$TIMELOG" -D "$@" -} - # ** END if [[ $# -eq 0 ]]; then help # no args shows help