diff options
author | Ratakor <ratakor@disroot.org> | 2023-04-14 14:15:45 +0200 |
---|---|---|
committer | Ratakor <ratakor@disroot.org> | 2023-04-14 14:15:45 +0200 |
commit | 167032155ffac03604c060ccf88dd356c88b2079 (patch) | |
tree | 6f30f367ceada486353783172242cf48911ea348 | |
parent | 3ed631d8646501162fee6beec6e8a5a605b11e4b (diff) |
add man page
-rw-r--r-- | Makefile | 18 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rwxr-xr-x | quand | 24 | ||||
-rw-r--r-- | quand.1 | 74 |
4 files changed, 97 insertions, 20 deletions
@@ -1,22 +1,24 @@ .POSIX: +NAME = quand VERSION = 0.4 + PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man all: - @printf "Run 'sudo make install' to install quand.\n" + @printf "Run 'sudo make install' to install ${NAME}.\n" install: mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f quand ${DESTDIR}${PREFIX}/bin - chmod 755 ${DESTDIR}${PREFIX}/bin/quand - @#mkdir -p ${DESTDIR}${MANPREFIX}/man1 - @#sed "s/VERSION/${VERSION}/g" < quand.1 > ${DESTDIR}${MANPREFIX}/man1/quand.1 - @#chmod 644 ${DESTDIR}${MANPREFIX}/man1/quand.1 + cp -f ${NAME} ${DESTDIR}${PREFIX}/bin + chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME} + mkdir -p ${DESTDIR}${MANPREFIX}/man1 + cp -f ${NAME}.1 ${DESTDIR}${MANPREFIX}/man1 + chmod 644 ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 uninstall: - rm -f ${DESTDIR}${PREFIX}/bin/quand - @#${DESTDIR}${MANPREFIX}/man1/quand.1 + rm -f ${DESTDIR}${PREFIX}/bin/${NAME}\ + ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 .PHONY: all install uninstall @@ -62,4 +62,3 @@ mondayfirst=0 ## TODO - add a ICS file converter or handle ICS files -- add a man page @@ -67,10 +67,11 @@ calendar() { args() { while [ -n "$*" ]; do - [ -z "$2" ] && - printf '\033[31mError:\033[m no argument given\n' 1>&2 && - usage && + if [ -z "$2" ]; then + printf '\033[31mError:\033[m no argument given\n' 1>&2 + usage exit 1 + fi case $1 in -c|--calendar) calendar="$2" ;; @@ -90,21 +91,22 @@ args() { } usage() { - printf 'Usage: %s [options] + cat << EOF 1>&2 +Usage: ${0##*/} [options] Options: no option | Default --h|--help │ Print this help message and exit --v|--version | Print the version +e|edit | Edit the calendar file +c|cal [n] | Print a calendar with 1 or n months + | -c|--calendar [path] | Temporarily change the calendar file used -p|--past [n] | Temporarily change past (n is negative) -f|--future [n] | Temporarily change future (n is positive) - | -e|edit | Edit the calendar file -c|cal [n] | Print a calendar with 1 or n months +-h|--help │ Print this help message +-v|--version | Print version information -Have a look at the README for more information about the configuration.\n'\ - "${0##*/}" 1>&2 +Have a look at the man page for more information about the configuration. +EOF } main() { @@ -0,0 +1,74 @@ +.Dd April 14, 2023 +.Dt QUAND 1 +.Sh NAME +.Nm quand +.Nd simple calendar +.Sh SYNOPSIS +.Nm +.Op OPTIONS +.Sh DESCRIPTION +.Nm +is a simple calendar for the command line. +.Pp +.Sh OPTIONS +.Bl -tag -width Ds +.It e, edit +Edit the calendar file. +.It c, cal Op Ar n +Print a calendar with 1 or +.Ar n +months. +.It Fl c , -calendar Ar path +Temporarily change the calendar file used. +.It Fl p , -past Ar n +Temporarily change past (n is negative). +.It Fl f , -future Ar n +Temporarily change future (n is positive). +.It Fl h , -help +Print an help message to stderr and exit. +.It Fl v , -version +Print version information to stderr and exit. +.El +.Sh CONFIGURATION +$XDG_CONFIG_HOME/quand/config +.Nd +Default config file. If XDG_CONFIG_HOME is not set, $HOME/.config/ is used. +.Pp +Default configuration: + language=en_US.UTF-8 + calendar=/home/username/.local/share/quand/calendar + editor=vi + header=1 + past=-1 + future=14 + yesterday="yesterday " + today="\\033[1mtoday " + tomorrow="tomorrow " + special="special " + spaces=" " + mondayfirst=0 +.Sh EXAMPLE +$XDG_DATA_HOME/quand/calendar +.Nd +Default calendar file. If XDG_DATA_HOME is not set, $HOME/.local/share is used. +.Pp +Example of calendar file: + # Don't forget the 0 behind month or day + 2023 04 28, 07:30 -> 09:30 English + 2023 03 12, Dentist + + # For events that happen once a week: + # The name of each day depends on your locale + Mon, don't forget to update with emerge -uDN @world + Fri, it's friday! + + # Use a star for events that happen once a year: + * 08 10, Mum's anniversary + * 07 14, Bastille Day + + # Use 2 stars for events that happen once a month: + * * 01, Happy New Month! + + # Use 3 stars to always show an event: + * * * Good Morning :) + * * * 2023 03 31, URGENT don't forget your meeting |