summaryrefslogtreecommitdiff
path: root/bin/extra
diff options
context:
space:
mode:
Diffstat (limited to 'bin/extra')
-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