.TH SCHAIN 1 schain\-VERSION
.SH NAME
.PP
schain \- A simple habit tracker
.SH SYNOPSIS
.PP
.B schain
.RB [ \-krsv ]
.RB [ \-cK
.IR num ]
.RB [ \-w
.IR date ]
.RB [ file ]
.SH DESCRIPTION
.PP
.B schain
is a simple habit tracker that lets you keep count of
how many days you've been following through an habit.
.PP
Using
.B schain
is very simple.
You first create a new tracking file using the
.I \-c
option, providing a number to start counting from.
.PP
Each day you've fulfilled your goal, check in using
.I \-k
to increase the count by 1 day.
(Or, alternatively, use
.I \-K
to increase the count by an arbitrary number of days.)
The new count is printed to standard output.
By default, the check-in date is the current date.
.PP
You may manually set the stored date by passing it in YYYY-MM-DD format using
.IR \-w .
You may use this option along with any other options available.
.PP
By default,
.B schain
prints the count to standard output.
The default unit is days,
but this is customizable in the source file
.I config.h.
If you would like to just get the number of days printed
(for example, when running
.B schain
from a shell script),
pass the
.I \-s
option.
This option is compatible with all other options mentioned above.
.SH OPTIONS
.TP
.B \-c " num"
Create new tracking
.I file
starting the count from
.I num
day(s).
.TP
.B \-k
Check in a new day.
.TP
.B \-K " num"
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
.B \-v
Show version information and exit.
.TP
.B \-w " date"
Set last date in
.I file
to
.I date.
.SH EXIT STATUS
Upon successful execution
.B schain
returns 0 as its exit status.
Otherwise, an exit status greater than zero is returned.
.SH ENVIRONMENT
.PP
Execution of
.B schain
is affected by the following environment variables:
.TP
.B SCHAIN_DEF_FILE
Sets a default file location that
.B schain
opens if run without a
.I file
argument.
.SH EXAMPLES
.PP
Creating a new tracker:
.PP
.nf
.RS
.RB $ " schain \-c 0 no-smoke"
.br
2020-12-19: 0 day(s).
.RE
.fi
.PP
Checking in a new day in a tracker file:
.PP
.nf
.RS
.RB $ " schain \-k no-smoke"
.br
2020-12-20: 1 day(s).
.RE
.fi
.PP
Checking the contents of a tracker file:
.PP
.nf
.RS
.RB $ " schain no-smoke"
.br
2020-12-27: 8 day(s).
.RE
.fi
.PP
To change the date stored in a tracker, while also checking in:
.PP
.nf
.RS
.RB $ " schain \-k \-w 2020-12-30 no-smoke"
.br
2020-12-30: 9 day(s).
.RE
.fi
.SH SEE ALSO
None.