diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-07-01 01:14:59 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-07-01 01:14:59 +0200 |
commit | e1de506156454ba1d324faf548ad15fe804aa806 (patch) | |
tree | 1ca249b22bace59d41e950b7482443440ccc8c5e /bin/extra/clock | |
parent | fecb6306631aaec1774497093b7da44ab5950d92 (diff) | |
parent | b2077bbddf86dbdbf6cc63aaf2ceb8a2da614ebc (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/extra/clock')
-rwxr-xr-x | bin/extra/clock | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/bin/extra/clock b/bin/extra/clock index bd6efd2..6c5bfe0 100755 --- a/bin/extra/clock +++ b/bin/extra/clock @@ -1,12 +1,25 @@ #!/bin/sh -clocks="${XDG_DATA_HOME:-$HOME}"/clocks.csv +clocks="$HOME"/sync/share/clocks.csv -if [ ! -f "$clocks" ] -then +# Create csv file with headers if not exist +[ -f "$clocks" ] || printf 'start,end,message\n' > "$clocks" + + +if [ "$1" = "-h" ] +then + >&2 cat <<EOF +usage: clock [OPTION] +-h shows this help +-p print clockings prettily + +With no option it will start clocking and prompt for a task. +EOF + exit 1 fi + # print clocks file prettily if [ "$1" = "-p" ] then |