;just: twih: improve output, copy to clipboard
This commit is contained in:
parent
f3f5fae83f
commit
7e8f9f09dd
46
Justfile
46
Justfile
@ -929,20 +929,33 @@ NEWS:
|
|||||||
# Show a draft This Week In Hledger post, with activity between the last two fridays (by default)
|
# Show a draft This Week In Hledger post, with activity between the last two fridays (by default)
|
||||||
twih: # *DATE:
|
twih: # *DATE:
|
||||||
#!/usr/bin/env osh
|
#!/usr/bin/env osh
|
||||||
BEG=`just _dateortwofridaysago $DATE`
|
# BEG=`just _dateortwofridaysago $DATE`
|
||||||
END=`just _todayorlastfriday $DATE`
|
END=`just _todayorlastfriday $DATE`
|
||||||
cat <<END
|
cat <<EOS
|
||||||
|
== TWIH notes: ========================================
|
||||||
|
|
||||||
|
last release: `just rel`
|
||||||
|
|
||||||
|
`cal`
|
||||||
|
`just timelog $DATE`
|
||||||
|
|
||||||
|
`just worklog $DATE`
|
||||||
|
|
||||||
|
recent issue activity:
|
||||||
|
https://github.com/simonmichael/hledger/issues?q=sort:updated-desc
|
||||||
|
|
||||||
|
|
||||||
|
== TWIH draft (in clipboard) : ========================
|
||||||
|
|
||||||
|
EOS
|
||||||
|
(cat <<EOS
|
||||||
|
---
|
||||||
|
|
||||||
## This Week In Hledger $END
|
## This Week In Hledger $END
|
||||||
|
|
||||||
**sm**
|
**sm**
|
||||||
|
|
||||||
END
|
`just commitlog $DATE`
|
||||||
printf "DRAFT:\n\n"
|
|
||||||
just commitlog $DATE
|
|
||||||
printf "last release: `just rel`\n\n"
|
|
||||||
just worklog $DATE
|
|
||||||
just timelog $DATE
|
|
||||||
cat <<END
|
|
||||||
|
|
||||||
**Misc**
|
**Misc**
|
||||||
|
|
||||||
@ -955,9 +968,10 @@ twih: # *DATE:
|
|||||||
**
|
**
|
||||||
|
|
||||||
<https://hledger.org/news.html#this-week-in-hledger-$END>
|
<https://hledger.org/news.html#this-week-in-hledger-$END>
|
||||||
|
|
||||||
|
|
||||||
---
|
EOS
|
||||||
END
|
) | tee /dev/tty | pbcopy
|
||||||
|
|
||||||
GITSHORTFMT := "--format='%ad %s' --date=short"
|
GITSHORTFMT := "--format='%ad %s' --date=short"
|
||||||
|
|
||||||
@ -991,8 +1005,8 @@ worklog *DATE:
|
|||||||
# LOGGEDDATES=`just worklogdates`
|
# LOGGEDDATES=`just worklogdates`
|
||||||
BEGLOGGED=`just worklogdates | $GHC -e "getContents >>= putStrLn . head . dropWhile (< \"$BEG\") . (++[\"9999-99-99\"]) . lines"`
|
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"`
|
# 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 "hledger work log in $BEG..:\n"
|
||||||
# printf "** Work log in $BEGLOGGED..$ENDLOGGED\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}; /^## /{p=0}; p" "$WORKLOG"
|
||||||
# awk "/^#### $BEGLOGGED/{p=1;print;next}; /#### $ENDLOGGED/{p=0}; /^## /{p=0}; p" "$WORKLOG"
|
# awk "/^#### $BEGLOGGED/{p=1;print;next}; /#### $ENDLOGGED/{p=0}; /^## /{p=0}; p" "$WORKLOG"
|
||||||
echo
|
echo
|
||||||
@ -1003,11 +1017,11 @@ timelog *DATE:
|
|||||||
BEG=`just _dateortwofridaysago $DATE`
|
BEG=`just _dateortwofridaysago $DATE`
|
||||||
END=`just _todayorlastfriday $DATE`
|
END=`just _todayorlastfriday $DATE`
|
||||||
END1=`just _tomorroworlastfriday $DATE`
|
END1=`just _tomorroworlastfriday $DATE`
|
||||||
printf "** Time log in $BEG..$END\n\n"
|
printf "hledger time logged in $BEG..$END:\n\n"
|
||||||
hledger -f $TIMELOG print hledger -b $BEG -e $END1 | rg '^2|hledger'
|
|
||||||
echo
|
|
||||||
hledger -f $TIMELOG bal -S --format '%-20(account) %12(total)' hledger -b $BEG -e $END1
|
hledger -f $TIMELOG bal -S --format '%-20(account) %12(total)' hledger -b $BEG -e $END1
|
||||||
echo
|
echo
|
||||||
|
hledger -f $TIMELOG print hledger -b $BEG -e $END1 | rg '^2|hledger'
|
||||||
|
echo
|
||||||
|
|
||||||
# Copy some text to the system clipboard if possible
|
# Copy some text to the system clipboard if possible
|
||||||
@_clip TEXT:
|
@_clip TEXT:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user