diff options
| author | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2021-05-08 19:19:41 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2021-05-08 19:19:41 +0200 |
| commit | 82bcfe3f25b1f0c08c93fd35497019b546e24ce2 (patch) | |
| tree | 055309330ff16f6d3f754b2ef6eaff92fe3925ed /sdep.1 | |
| parent | 61d15dd4854fe4607442b87602448d6dee16b6a8 (diff) | |
| download | sdep-82bcfe3f25b1f0c08c93fd35497019b546e24ce2.tar.gz sdep-82bcfe3f25b1f0c08c93fd35497019b546e24ce2.zip | |
First commit, v0.1
Diffstat (limited to 'sdep.1')
| -rw-r--r-- | sdep.1 | 106 |
1 files changed, 106 insertions, 0 deletions
| @@ -0,0 +1,106 @@ | |||
| 1 | .TH SDEP 1 sdep\-VERSION | ||
| 2 | |||
| 3 | .SH NAME | ||
| 4 | sdep \- a simple "date+event" line parser | ||
| 5 | |||
| 6 | .SH SYNOPSIS | ||
| 7 | .B sdep | ||
| 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 | ||
| 22 | |||
| 23 | .IR "date text" | ||
| 24 | |||
| 25 | from stdin and writes to stdout those lines such that | ||
| 26 | .IR date | ||
| 27 | is between the two dates specified by the | ||
| 28 | .IR \-f | ||
| 29 | and | ||
| 30 | .IR \-t | ||
| 31 | options, both of which default to the current minute. | ||
| 32 | The dates should correspond to a unique minute in time. The format for | ||
| 33 | .IR date | ||
| 34 | can be specified with the same syntax as for | ||
| 35 | .IR date (1). | ||
| 36 | |||
| 37 | .SH OPTIONS | ||
| 38 | |||
| 39 | .TP | ||
| 40 | .B \-d | ||
| 41 | print the default date format and exit. | ||
| 42 | |||
| 43 | .TP | ||
| 44 | .BI \-f " [date]" | ||
| 45 | initial date for the range (default: current minute). If | ||
| 46 | .I date | ||
| 47 | is not specified then there will be no lower bound for the dates. | ||
| 48 | |||
| 49 | .TP | ||
| 50 | .BI \-s " string" | ||
| 51 | change the string that separates the date from the text in the output | ||
| 52 | lines (deafult: "\t"). | ||
| 53 | |||
| 54 | .TP | ||
| 55 | .BI \-t " [date]" | ||
| 56 | final date for the range (default: current minute). If | ||
| 57 | .I date | ||
| 58 | is not specified then there will be no upper bound for the dates. | ||
| 59 | |||
| 60 | .TP | ||
| 61 | .B \-v | ||
| 62 | print version information and exit. | ||
| 63 | |||
| 64 | .TP | ||
| 65 | .BI \-w " format" | ||
| 66 | change the format in which the date is written in the output lines. | ||
| 67 | |||
| 68 | .SH EXAMPLES | ||
| 69 | If | ||
| 70 | .I events.txt | ||
| 71 | contains lines formatted as | ||
| 72 | .I "date text" | ||
| 73 | then | ||
| 74 | |||
| 75 | sdep -f <events.txt | ||
| 76 | |||
| 77 | will print all the lines whose date is in the past, while | ||
| 78 | |||
| 79 | sdep -t -w "%A" <events.txt | ||
| 80 | |||
| 81 | will print all lines whose date is in the future, showing only the day of the | ||
| 82 | week and the text. | ||
| 83 | |||
| 84 | sdep -f "1999-01-01 00:00" -t "1999-12-31 23:59" -w "" <events.txt | ||
| 85 | |||
| 86 | will show only the | ||
| 87 | .I text | ||
| 88 | of all lines with a date in 1999. You can specify a different format for the | ||
| 89 | dates, for example | ||
| 90 | |||
| 91 | sdep +"%m/%d/%Y %I:%M%p" -t "12/31/2020 11:59pm" -w "" <events.txt | ||
| 92 | |||
| 93 | 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 | ||
| 95 | .IR date (1). | ||
| 96 | |||
| 97 | .SH AUTHORS | ||
| 98 | Sebastiano Tronto <sebastiano.tronto@gmail.com> | ||
| 99 | |||
| 100 | .SH SOURCE CODE | ||
| 101 | Source code is available at https://github.com/sebastianotronto/sdep | ||
| 102 | |||
| 103 | .SH SEE ALSO | ||
| 104 | .IR date (1), | ||
| 105 | .IR strftime (3), | ||
| 106 | .IR strptime (3) | ||
