aboutsummaryrefslogtreecommitdiff
path: root/sdep.1
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-05-13 22:27:27 +0200
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-05-13 22:27:27 +0200
commit9c885d3172da1865df9db8f07a607a23eb26a80f (patch)
treea64aa3b2a6caaf73f0920cae2580000403e91cb3 /sdep.1
parent1e7001ae3ec5c55cc8f621a81da33eb9c0061ebc (diff)
downloadsdep-9c885d3172da1865df9db8f07a607a23eb26a80f.tar.gz
sdep-9c885d3172da1865df9db8f07a607a23eb26a80f.zip
I'm a roff noob
Diffstat (limited to 'sdep.1')
-rw-r--r--sdep.1118
1 files changed, 53 insertions, 65 deletions
diff --git a/sdep.1 b/sdep.1
index 8cbdd24..302c45d 100644
--- a/sdep.1
+++ b/sdep.1
@@ -1,106 +1,94 @@
1.TH SDEP 1 sdep\-VERSION 1.Dd May 13, 2021
2.Dt SDEP 1
3.Os
4.Sh NAME
5.Nm sdep
6.Nd a simple "date+event" line parser
2 7
3.SH NAME 8.Sh SYNOPSIS
4sdep \- a simple "date+event" line parser 9.Nm
10.Op Fl dv
11.Op Ar +format
12.Op Fl f Op Ar date
13.Op Fl t Op Ar date
14.Op Fl w Ar format
15.Op Fl s Ar string
5 16
6.SH SYNOPSIS 17.Sh DESCRIPTION
7.B sdep 18.Nm
8.RB [ \-dv ]
9.IR "[+format]"
10.RB [ \-f
11.IR "[date]" ]
12.RB [ \-t
13.IR "[date]" ]
14.RB [ \-w
15.IR format ]
16.RB [ \-s
17.IR string ]
18
19.SH DESCRIPTION
20.B sdep
21reads lines of the form 19reads lines of the form
22 20
23.IR "date text" 21.Dl Ar "date text"
24 22
25from stdin and writes to stdout those lines such that 23from stdin and writes to stdout those lines such that
26.IR date 24.Ar date
27is between the two dates specified by the 25is between the dates specified by the
28.IR \-f 26.Fl f
29and 27and
30.IR \-t 28.Fl t
31options, both of which default to the current minute. 29options, both defaulting to the current minute.
32The dates should correspond to a unique minute in time. The format for 30The dates should correspond to a unique minute in time. The format for
33.IR date 31.Ar date
34can be specified with the same syntax as for 32can be specified with the same syntax as for
35.IR date (1). 33.Xr date 1 .
36
37.SH OPTIONS
38 34
39.TP 35The options are as follows:
40.B \-d 36.Bl -tag -width Ds
37.It Fl d
41print the default date format and exit. 38print the default date format and exit.
42 39.It Fl f Op Ar date
43.TP
44.BI \-f " [date]"
45initial date for the range (default: current minute). If 40initial date for the range (default: current minute). If
46.I date 41.Ar date
47is not specified then there will be no lower bound for the dates. 42is not specified there will be no lower bound for the dates.
48 43.It Fl s Ar string
49.TP
50.BI \-s " string"
51change the string that separates the date from the text in the output 44change the string that separates the date from the text in the output
52lines (deafult: "\t"). 45lines (deafult: "\t").
53 46.It Fl t Op Ar date
54.TP
55.BI \-t " [date]"
56final date for the range (default: current minute). If 47final date for the range (default: current minute). If
57.I date 48.Ar date
58is not specified then there will be no upper bound for the dates. 49is not specified then there will be no upper bound for the dates.
59 50.It Fl v
60.TP
61.B \-v
62print version information and exit. 51print version information and exit.
63 52.It Fl w Ar format
64.TP
65.BI \-w " format"
66change the format in which the date is written in the output lines. 53change the format in which the date is written in the output lines.
67 54
68.SH EXAMPLES 55.Sh EXAMPLES
69If 56If
70.I events.txt 57.Ar events.txt
71contains lines formatted as 58contains lines formatted as
72.I "date text" 59.Ar "date text"
73then 60then
74 61
75sdep -f <events.txt 62.Dl sdep -f <events.txt
76 63
77will print all the lines whose date is in the past, while 64will print all the lines whose date is in the past, while
78 65
79sdep -t -w "%A" <events.txt 66.Dl sdep -t -w "%A" <events.txt
80 67
81will print all lines whose date is in the future, showing only the day of the 68will print all lines whose date is in the future, showing only the day of the
82week and the text. 69week and the text.
83 70
84sdep -f "1999-01-01 00:00" -t "1999-12-31 23:59" -w "" <events.txt 71.Dl sdep -f "1999-01-01 00:00" -t "1999-12-31 23:59" -w "" <events.txt
85 72
86will show only the 73will show only the
87.I text 74.Ar text
88of all lines with a date in 1999. You can specify a different format for the 75of all lines with a date in 1999. You can specify a different format for the
89dates, for example 76dates, for example
90 77
91sdep +"%m/%d/%Y %I:%M%p" -t "12/31/2020 11:59pm" -w "" <events.txt 78.Dl sdep +"%m/%d/%Y %I:%M%p" -t "12/31/2020 11:59pm" -w "" <events.txt
92 79
93will match all dates from December 31st, 2020, one minute before midnight 80will match all dates from December 31st, 2020, one minute before midnight
94(included). Note: this only works if your locale has an am/pm format, see 81(included). Note: this only works if your locale has an am/pm format, see
95.IR date (1). 82.Xr date 1 .
96 83
97.SH AUTHORS 84.Sh AUTHORS
98Sebastiano Tronto <sebastiano.tronto@gmail.com> 85.An Sebastiano Tronto Aq Mt sebastiano.tronto@gmail.com
99 86
100.SH SOURCE CODE 87.Sh SOURCE CODE
101Source code is available at https://github.com/sebastianotronto/sdep 88Source code is available at
89.Lk https://github.com/sebastianotronto/sdep
102 90
103.SH SEE ALSO 91.Sh SEE ALSO
104.IR date (1), 92.Xr date 1 ,
105.IR strftime (3), 93.Xr strftime 3 ,
106.IR strptime (3) 94.Xr strptime 3

Generated with cgit - Back to sebastiano.tronto.net