~arivigo/schain

61e569b7f312a460a607650f4c87ec6b93b89ebb — Ariadna Vigo 2 months ago c1a1b63
New -r option: reset to zero
2 files changed, 12 insertions(+), 3 deletions(-)

M schain.1
M schain.c
M schain.1 => schain.1 +6 -1
@@ 5,7 5,7 @@ schain \- A simple habit tracker
.SH SYNOPSIS
.PP
.B schain
.RB [ \-ksv ]
.RB [ \-krsv ]
.RB [ \-cK 
.IR num ]
.RB [ \-w


@@ 68,6 68,11 @@ Check in a
.I num
number of days.
.TP
.B \-r
Reset file to zero days
(equivalent to passing 
.IR "-c 0" .)
.TP
.B \-s
Only output the number of days, without the description.
.TP

M schain.c => schain.c +6 -2
@@ 52,7 52,7 @@ die(const char *fmt, ...)
static void
usage(void)
{
	die("usage: schain [-ksv] [-cK num] [-w date] [file]");
	die("usage: schain [-krsv] [-cK num] [-w date] [file]");
}

static void


@@ 115,11 115,15 @@ main(int argc, char *argv[])
	mode = DEF_MODE;
	out_fmt = LONG_OUT;

	while ((opt = getopt(argc, argv, ":ksvc:K:w:")) != -1) {
	while ((opt = getopt(argc, argv, ":krsvc:K:w:")) != -1) {
		switch (opt) {
		case 'k':
			mode = CHECKIN_MODE;
			break;
		case 'r':
			mode = CREATE_MODE;
			num = 0;
			break;
		case 's':
			out_fmt = SHORT_OUT;
			break;