summaryrefslogtreecommitdiff
path: root/bin/extra/clock
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-06-24 17:06:18 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-06-24 17:06:18 +0200
commitd5a7a2df1fdeb2d82c51a0d78493bfb7241160c2 (patch)
tree1ac695a756e3570bf06b1a7658d143fc2b264657 /bin/extra/clock
parent1f7e952a75a870b0a4e9900964cae3729c216cc3 (diff)
checkpoint
Diffstat (limited to 'bin/extra/clock')
-rwxr-xr-xbin/extra/clock19
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