Skip to content

Commit

Permalink
;doc:bin:tt: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Jul 6, 2023
1 parent 519b305 commit 0d641ad
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 30 deletions.
38 changes: 20 additions & 18 deletions bin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 14 additions & 12 deletions bin/tt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -128,18 +130,27 @@ 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
echo "Undeclared: (but used)"
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
Expand All @@ -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
Expand Down

0 comments on commit 0d641ad

Please sign in to comment.