From 7e8f9f09ddc5548c021c9b8847225253b8974d1c Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 23 May 2024 09:26:53 -1000 Subject: [PATCH] ;just: twih: improve output, copy to clipboard --- Justfile | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/Justfile b/Justfile index 90521ce72..779d2676a 100644 --- a/Justfile +++ b/Justfile @@ -929,20 +929,33 @@ NEWS: # Show a draft This Week In Hledger post, with activity between the last two fridays (by default) twih: # *DATE: #!/usr/bin/env osh - BEG=`just _dateortwofridaysago $DATE` + # BEG=`just _dateortwofridaysago $DATE` END=`just _todayorlastfriday $DATE` - cat < + - --- - END + EOS + ) | tee /dev/tty | pbcopy GITSHORTFMT := "--format='%ad %s' --date=short" @@ -991,8 +1005,8 @@ worklog *DATE: # LOGGEDDATES=`just worklogdates` BEGLOGGED=`just worklogdates | $GHC -e "getContents >>= putStrLn . head . dropWhile (< \"$BEG\") . (++[\"9999-99-99\"]) . lines"` # ENDLOGGED=`just worklogdates | $GHC -e "getContents >>= putStrLn . head . takeWhile (< \"$END\") . (++[\"9999-99-99\"]) . dropWhile (< \"$BEG\") . (++[\"9999-99-99\"]) . lines"` - printf "** Work log in $BEG..\n" - # printf "** Work log in $BEGLOGGED..$ENDLOGGED\n" + printf "hledger work log in $BEG..:\n" + # printf "hledger work log in $BEGLOGGED..$ENDLOGGED:\n" awk "/^#### $BEGLOGGED/{p=1;print;next}; /^## /{p=0}; p" "$WORKLOG" # awk "/^#### $BEGLOGGED/{p=1;print;next}; /#### $ENDLOGGED/{p=0}; /^## /{p=0}; p" "$WORKLOG" echo @@ -1003,11 +1017,11 @@ timelog *DATE: BEG=`just _dateortwofridaysago $DATE` END=`just _todayorlastfriday $DATE` END1=`just _tomorroworlastfriday $DATE` - printf "** Time log in $BEG..$END\n\n" - hledger -f $TIMELOG print hledger -b $BEG -e $END1 | rg '^2|hledger' - echo + printf "hledger time logged in $BEG..$END:\n\n" hledger -f $TIMELOG bal -S --format '%-20(account) %12(total)' hledger -b $BEG -e $END1 echo + hledger -f $TIMELOG print hledger -b $BEG -e $END1 | rg '^2|hledger' + echo # Copy some text to the system clipboard if possible @_clip TEXT: