diff options
| author | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2021-05-13 22:27:27 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2021-05-13 22:27:27 +0200 |
| commit | 9c885d3172da1865df9db8f07a607a23eb26a80f (patch) | |
| tree | a64aa3b2a6caaf73f0920cae2580000403e91cb3 /sdep.1 | |
| parent | 1e7001ae3ec5c55cc8f621a81da33eb9c0061ebc (diff) | |
| download | sdep-9c885d3172da1865df9db8f07a607a23eb26a80f.tar.gz sdep-9c885d3172da1865df9db8f07a607a23eb26a80f.zip | |
I'm a roff noob
Diffstat (limited to 'sdep.1')
| -rw-r--r-- | sdep.1 | 118 |
1 files changed, 53 insertions, 65 deletions
| @@ -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 |
| 4 | sdep \- 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 | ||
| 21 | reads lines of the form | 19 | reads lines of the form |
| 22 | 20 | ||
| 23 | .IR "date text" | 21 | .Dl Ar "date text" |
| 24 | 22 | ||
| 25 | from stdin and writes to stdout those lines such that | 23 | from stdin and writes to stdout those lines such that |
| 26 | .IR date | 24 | .Ar date |
| 27 | is between the two dates specified by the | 25 | is between the dates specified by the |
| 28 | .IR \-f | 26 | .Fl f |
| 29 | and | 27 | and |
| 30 | .IR \-t | 28 | .Fl t |
| 31 | options, both of which default to the current minute. | 29 | options, both defaulting to the current minute. |
| 32 | The dates should correspond to a unique minute in time. The format for | 30 | The dates should correspond to a unique minute in time. The format for |
| 33 | .IR date | 31 | .Ar date |
| 34 | can be specified with the same syntax as for | 32 | can be specified with the same syntax as for |
| 35 | .IR date (1). | 33 | .Xr date 1 . |
| 36 | |||
| 37 | .SH OPTIONS | ||
| 38 | 34 | ||
| 39 | .TP | 35 | The options are as follows: |
| 40 | .B \-d | 36 | .Bl -tag -width Ds |
| 37 | .It Fl d | ||
| 41 | print the default date format and exit. | 38 | print the default date format and exit. |
| 42 | 39 | .It Fl f Op Ar date | |
| 43 | .TP | ||
| 44 | .BI \-f " [date]" | ||
| 45 | initial date for the range (default: current minute). If | 40 | initial date for the range (default: current minute). If |
| 46 | .I date | 41 | .Ar date |
| 47 | is not specified then there will be no lower bound for the dates. | 42 | is not specified there will be no lower bound for the dates. |
| 48 | 43 | .It Fl s Ar string | |
| 49 | .TP | ||
| 50 | .BI \-s " string" | ||
| 51 | change the string that separates the date from the text in the output | 44 | change the string that separates the date from the text in the output |
| 52 | lines (deafult: "\t"). | 45 | lines (deafult: "\t"). |
| 53 | 46 | .It Fl t Op Ar date | |
| 54 | .TP | ||
| 55 | .BI \-t " [date]" | ||
| 56 | final date for the range (default: current minute). If | 47 | final date for the range (default: current minute). If |
| 57 | .I date | 48 | .Ar date |
| 58 | is not specified then there will be no upper bound for the dates. | 49 | is not specified then there will be no upper bound for the dates. |
| 59 | 50 | .It Fl v | |
| 60 | .TP | ||
| 61 | .B \-v | ||
| 62 | print version information and exit. | 51 | print version information and exit. |
| 63 | 52 | .It Fl w Ar format | |
| 64 | .TP | ||
| 65 | .BI \-w " format" | ||
| 66 | change the format in which the date is written in the output lines. | 53 | change the format in which the date is written in the output lines. |
| 67 | 54 | ||
| 68 | .SH EXAMPLES | 55 | .Sh EXAMPLES |
| 69 | If | 56 | If |
| 70 | .I events.txt | 57 | .Ar events.txt |
| 71 | contains lines formatted as | 58 | contains lines formatted as |
| 72 | .I "date text" | 59 | .Ar "date text" |
| 73 | then | 60 | then |
| 74 | 61 | ||
| 75 | sdep -f <events.txt | 62 | .Dl sdep -f <events.txt |
| 76 | 63 | ||
| 77 | will print all the lines whose date is in the past, while | 64 | will print all the lines whose date is in the past, while |
| 78 | 65 | ||
| 79 | sdep -t -w "%A" <events.txt | 66 | .Dl sdep -t -w "%A" <events.txt |
| 80 | 67 | ||
| 81 | will print all lines whose date is in the future, showing only the day of the | 68 | will print all lines whose date is in the future, showing only the day of the |
| 82 | week and the text. | 69 | week and the text. |
| 83 | 70 | ||
| 84 | sdep -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 | ||
| 86 | will show only the | 73 | will show only the |
| 87 | .I text | 74 | .Ar text |
| 88 | of all lines with a date in 1999. You can specify a different format for the | 75 | of all lines with a date in 1999. You can specify a different format for the |
| 89 | dates, for example | 76 | dates, for example |
| 90 | 77 | ||
| 91 | sdep +"%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 | ||
| 93 | will match all dates from December 31st, 2020, one minute before midnight | 80 | will 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 |
| 98 | Sebastiano 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 |
| 101 | Source code is available at https://github.com/sebastianotronto/sdep | 88 | Source 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 |
