~arivigo/schain

ref: f216bd5a36501cd6440dad3cce050c79a04b3ffc schain/schain.1 -rw-r--r-- 2.5 KiB
f216bd5aAriadna Vigo Makefile: removed syntax not defined by POSIX 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
.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.