ncalendar

Reimplementation of the BSD calendar(1) program in Rust

git clone https://git.8pit.net/ncalendar.git

commits

2023-02-16 format: use char() instead of tag() for parse_offset Sören Tempel
2023-02-16 lib: Make parser for weekday offset more strict Sören Tempel
2023-02-16 Add fast path for semi-weekly reminders Sören Tempel
2023-02-15 format: Require an explicit +/- sign for moving events Sören Tempel
2023-02-15 main: Fix entry iteration Sören Tempel

Clone the repository to access all 82 commits.

About

This is an implementation of the calendar(1) program as available on many BSD variants.

Status

This is mostly intended as a toy project for experimenting a bit with Rust. The implementation is primarily inspired by the OpenBSD calendar(1) implementation and implements most of its feature. However, the input format is not intended to be fully compatible with OpenBSD.

Features

Installation

This software can be installed using the following commands:

$ cargo install --path .

This will drop the ncalendar binary into ~/.cargo/bin. Make sure that directory is in your $PATH.

Usage

The ncalendar(1) program reads calendar entries from the file ~/.ncalendar/calendar by default. The input format for this file is “documented” through parser combinators in src/lib/format.rs. When invoked, all calendar entries which match a certain time span are written to standard output. By default, entries for the current and the next day are printed. The time span can be configured, via the -B (backward), -A (forward) and -t (set different current date) command-line options an. For example:

$ ncalendar -B 3 -A 11 -t 20122022

Will print all calendars in the inclusive range between the 17th December of 2022 and the 31th December. The program is best invoked from a daily user-level cronjob.

Test

Unit tests can be executed using the following command:

$ cargo test

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.