Fix the txt2ics and update Makefile an README - ics2txt - convert icalendar .ics file to plain text HTML git clone git://bitreich.org/ics2txt git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/ics2txt DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit 661bba112f192b142affccb401ad9ffead2d2d45 DIR parent 04011029ed137087117a5e3a5cd779c2375c626b HTML Author: Josuah Demangeon <mail@josuah.net> Date: Wed, 30 May 2018 11:44:06 +0200 Fix the txt2ics and update Makefile an README Re-format the README from the man page and add the man page and the awk script to the Makefile Diffstat: M Makefile | 4 ++-- M README | 56 +++++++++++++++++++++++++------ M ics2txt.1 | 1 + M txt2ics | 15 ++++++++++++--- M txt2ics.1 | 1 + 5 files changed, 61 insertions(+), 16 deletions(-) --- DIR diff --git a/Makefile b/Makefile @@ -1,5 +1,5 @@ -BIN = ics2txt -MAN1 = ics2txt.1 +BIN = ics2txt txt2ics +MAN1 = ics2txt.1 txt2ics.1 all: DIR diff --git a/README b/README @@ -1,20 +1,19 @@ -AGENDA(1) General Commands Manual AGENDA(1) +ICS2TXT(1) General Commands Manual ICS2TXT(1) NAME - agenda plain text agenda with ical support + ics2txt convert ics file to plain text or TSV SYNOPSIS - agenda txt [+- offset [ics file...]] - agenda tsv [+- offset [ics file...]] + ics2txt txt [+-]offset [ics file...] + ics2txt tsv [+-]offset [ics file...] DESCRIPTION - agenda displays iCalendar (ical, .ics) files created by. + ics2txt displays iCalendar (ical, .ics) file or stdin if not specified in + the format described by the command: - agenda txt [+- offset [ics file...]] - Display the agenda(s) file as plain text sorted by date. + txt Display the ics2txt(s) file as plain text sorted by date. - agenda tsv [+- offset [ics file...]] - Display the agenda(s) file as a tab-separated values (tsv) one + tsv Display the ics2txt(s) file as a tab-separated values (tsv) one entry per line, with the following fields in order: DTSTART begin date as an UNIX timestamp DTEND end date as an UNIX timestamp @@ -27,9 +26,44 @@ ENVIRONMENT TZ Timezone to use for printing the dates. SEE ALSO - calendar(1), date(1), + calendar(1), date(1), txt2ics(1) + +STANDARDS + Desruisseaux, Internet Calendaring and Scheduling Core Object + Specification (iCalendar), RFC 5545, September 2009. + +AUTHORS + Josuah Demangeon <mail@josuah.net> + +OpenBSD 6.3 May 21, 2018 OpenBSD 6.3 + +------------------------------------------------------------------------------ + +TXT2ICS(1) General Commands Manual TXT2ICS(1) + +NAME + txt2ics convert plain text to an ics file + +SYNOPSIS + txt2ics + +DESCRIPTION + txt2ics prompts the user for event information and print them in the + iCalendar format. If stdin is ont a TTY, it will not print the prompt + string and act as a converter tool. + + It uses floating events: If it is 12:30, it will always be 12:30 of the + country he resides in: if he moves to another time zone, it will be 12:30 + of this new time zone. See this as the time zone where the event happen. + +SEE ALSO + calendar(1), date(1), ics2txt(1) + +STANDARDS + Desruisseaux, Internet Calendaring and Scheduling Core Object + Specification (iCalendar), RFC 5545, September 2009. AUTHORS Josuah Demangeon <mail@josuah.net> -OpenBSD 6.3 February 23, 2018 OpenBSD 6.3 +OpenBSD 6.3 May 30, 2018 OpenBSD 6.3 DIR diff --git a/ics2txt.1 b/ics2txt.1 @@ -72,6 +72,7 @@ Timezone to use for printing the dates. . .Sh SEE ALSO . +.Xr cal 1 , .Xr calendar 1 , .Xr date 1 , .Xr txt2ics 1 DIR diff --git a/txt2ics b/txt2ics @@ -3,7 +3,7 @@ function prompt(msg) { if (TTY) - printf("%s", msg) >"/dev/tty"; + printf("%s", msg) >"/dev/stderr"; if (!getline str) exit(1); return str; @@ -58,11 +58,20 @@ function parse_date(str, tm) BEGIN { TTY = !system("tty >/dev/null"); + if (TTY) { + "date +%Y" | getline yrs + close("date +%Y"); + system("cal " yrs ">/dev/stderr"); + system("date >/dev/stderr"); + system("date +'%Y/%m/%d %H:%M' >/dev/stderr"); + print("") >"/dev/stderr"; + } + do beg = prompt("Start [YYYY/MM/DD HH:MM] or [HH:MM] for today: "); - while (parse_date(beg, beg_tm) == -1); + while (parse_date(beg, tm_beg) == -1); do end = prompt("End [YYYY/MM/DD HH:MM] or [HH:MM] for same day: "); - while (parse_date(end, end_tm) == -1); + while (parse_date(end, tm_end) == -1); sum = prompt("Summary: "); cat = prompt("Category: "); DIR diff --git a/txt2ics.1 b/txt2ics.1 @@ -31,6 +31,7 @@ See this as the time zone where the event happen. . .Sh SEE ALSO . +.Xr cal 1 , .Xr calendar 1 , .Xr date 1 , .Xr ics2txt 1