;doc:bin:tt: updates

This commit is contained in:
Simon Michael 2023-07-06 08:36:16 -10:00
parent 519b305627
commit 0d641ad2b9
2 changed files with 34 additions and 30 deletions

View File

@ -109,24 +109,26 @@ $ t
tt - time tool: run time reports and time-related scripts tt - time tool: run time reports and time-related scripts
Usage: tt [COMMAND [ARGS]] Usage: tt [COMMAND [ARGS]]
Commands: Commands:
help show this help help show this help
dash show time dashboard, redisplaying when timelog files change dash show time dashboard, redisplaying when timelog files change
status show current time status status show current time status
what what happened ? Show largest balances first, today and depth 1 by default 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) dots print line of N dots, grouped in 4s (suitable for timedot)
x horizontal time summary this year, monthly by default x horizontal time summary this year, monthly by default
y vertical time summary this year, monthly by default y vertical time summary this year, monthly by default
rweeks recent weeks' time budgets rweeks recent weeks' time budgets
weeks this and last week's time budgets weeks this and last week's time budgets
unused unused & undeclared account names hours show a bar chart of daily hours
unusedcat unused & undeclared account names by category accunused show unused / undeclared accounts
budgets show monthly time budget performance this year accunusedcat show unused / undeclared accounts by category
budgetsy show monthly time budget performance this year, vertically accadd add declarations for all undeclared accounts
budgetsw show weekly time budget performance this year budgets show monthly time budget performance this year
budgetswx show weekly time budget performance this year, horizontally budgetsy show monthly time budget performance this year, vertically
addacc add declarations for all undeclared accounts budgetsw show weekly time budget performance this year
hours show a bar chart of daily hours budgetswx show weekly time budget performance this year, horizontally
OTHERCMD [ARGS] run other hledger commands on $TIMELOG OTHERCMD [ARGS] run other hledger commands on $TIMELOG
Add hledger options to customise reports.
``` ```
### watchaccounts ### watchaccounts

26
bin/tt
View File

@ -24,7 +24,9 @@ tt - time tool: run time reports and time-related scripts
Usage: tt [COMMAND [ARGS]] Usage: tt [COMMAND [ARGS]]
Commands: Commands:
$($rg '^\w.*\(\) *\{ *#' "$0" | $sed -e 's/() *{//' | column -t -s'#') $($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 EOF
} }
@ -128,7 +130,11 @@ weeks() { # this and last week's time budgets
timeweekly run 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)" echo "Unused: (but declared)"
hledger -f "$TIMELOG" acc --unused "$@" --directives | gsed -E 's/:(.)/.\1/g' hledger -f "$TIMELOG" acc --unused "$@" --directives | gsed -E 's/:(.)/.\1/g'
echo echo
@ -136,10 +142,15 @@ unused() { # unused & undeclared account names
hledger -f "$TIMELOG" acc --undeclared "$@" --directives | gsed -E 's/:(.)/.\1/g' 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 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() # Budget reports. cf status()
budgets() { # show monthly time budget performance this year 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 "$@" 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 # ** END
if [[ $# -eq 0 ]]; then help # no args shows help if [[ $# -eq 0 ]]; then help # no args shows help