From 59d7567edcf7913d6fb0a66b3c3ea47d1f3d27ba Mon Sep 17 00:00:00 2001 From: Rene Kita Date: Sat, 8 Apr 2023 16:55:09 +0200 Subject: [PATCH] Add a man page Also provide a Makefile which provides an install target. --- Makefile | 16 ++++++++++++ workinghours | 1 - workinghours.1 | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 100644 workinghours.1 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ad18737 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +PREFIX=/usr/local +MANPREFIX=$(PREFIX)/share/man + +all: + @echo "workinghours is a shell script, so there is nothing to do." + @echo "Try \"make install\" instead." + +.PHONY: install +install: workinghours + mkdir -p $(PREFIX)/bin $(MANPREFIX)/man1 + install workinghours $(PREFIX)/bin/ + install -m 644 workinghours.1 $(MANPREFIX)/man1 + +.PHONY: uninstall +uninstall: + rm -f $(PREFIX)/bin/workinghours $(MANPREFIX)/man1/workinghours.1 diff --git a/workinghours b/workinghours index bdac26e..17a683e 100755 --- a/workinghours +++ b/workinghours @@ -25,7 +25,6 @@ Mandatory arguments to long options are mandatory for short options too. --no-attach do not attach to session (only with --init) -s, --session NAME choose a session name (default: workinghours) -c, --customer NAME save files in subfolder NAME - -d, --day-sums show summarized hours per day -w, --new-week HOURS archive the current database file with number of last week into archive directory HOURS is the amount of hours your were supposed diff --git a/workinghours.1 b/workinghours.1 new file mode 100644 index 0000000..2954d5b --- /dev/null +++ b/workinghours.1 @@ -0,0 +1,71 @@ +.TH WORKINGHOURS 1 +.SH NAME +workinghours \- Log for how long you have been working +.SH SYNOPSIS +.B workinghours +[ +.B \-s +.I name +] +[ +.B \-v +] +.br +.B workinghours +[ +.B \-s +.I name +] +.B \-i +[ +.B \-\-no\-attach +] +[ +.B \-c +.I name +] +.PP +.B Warning: +You have to detach before ending the session! +Otherwise the last session duration will not be logged. +.SH DESCRIPTION +.I workinghours +lets you log your workinghours by attaching/detaching to a tmux session. +.PP +Without any options or with \-\-session only print a status message. +.SH OPTIONS +.TP +.B \-c, \-\-customer NAME +save files in subfolder NAME +.TP +.B \-i, \-\-init +set up a tmux session and attach +.TP +.B \-n, \-\-new\-week HOURS +archive the current database file with number of last week +into archive directory. +HOURS is the amount of hours your were supposed to work +.TP +.B \-\-no\-attach +do not attach to session (only with \-\-init) +.TP +.B \-s, \-\-session NAME +choose a session name (default: workinghours) +.TP +.B \-v +print the current database file with totals +.TP +.B \-w +alias for \-n +.TP +.B \-h, \-\-help +show this help +.PP +Any option can be combined with the \-\-session option. +.SH BUGS +You have to detach before ending the session! +Otherwise the last session duration will not be logged. +.SH AUTHOR +Rene Kita +.SH SEE ALSO +tmux(1) -- 2.45.2