🟠 Draft | Swiss knife for ical & caldav calendars
|
All checks were successful
continuous-integration/drone/push Build is passing
This change improves the documentation for `cal-load`, `cal-save`, `stack-load`, and `stack-save` commands, as well as the general overview, to explicitly state that when the --format option is omitted and the input/output path has no file extension, the format defaults to ICS or KMX, respectively. This prevents potential confusion for users who might expect format inference to fail in such cases, ensuring a more predictable user experience. - Added a new user story to cal-load.md, cal-save.md, stack-load.md, and stack-save.md to cover the scenario where --format is omitted and the path has no extension, clarifying the default format behavior. - Updated the "When reading from stdin" and "When writing to stdout" sections in cal-load.md, cal-save.md, stack-load.md, and stack-save.md to include the "or when the path has no extension" condition for default format application. - Modified the overview.md to refine the explanation of format inference, specifically addressing cases where inference is not possible (stdin/stdout or no extension) and the default format is applied. - Added a new test case, TestResolveFormat_NoExtensionDefaultsToICS, to pkg/basetypes/file_format_test.go to verify that ResolveFormat correctly defaults to ICS when no extension is present. Signed-off-by: Glenn Y. Rolland <glenux@glenux.net> |
||
|---|---|---|
| cmd | ||
| docs | ||
| pkg | ||
| .drone.yml | ||
| .gitignore | ||
| 2445AllExamples.ics | ||
| go.mod | ||
| go.sum | ||
| go.work | ||
| go.work.sum | ||
| kiwimix.cdx.json | ||
| kiwimix.spdx | ||
| LICENSE.txt | ||
| Makefile | ||
| NOTE.txt | ||
| README.md | ||
| ROADMAP.md | ||
Kiwimix
Stack-based CLI for building and transforming calendars.
Kiwimix operates on a calendar stack. Each operator maps to an operation, popping
and pushing calendars as it runs. Use @ to chain operators in a single run.
Features
- Stack-based execution with preflight validation.
- Chain operators with
@in one CLI call. - Works with
.icscalendars; supportsICSandJSONformats. - stdin/stdout support via
-forloadandsave.
Usage
Quick start
Merge and anonymize a calendar:
kiwimix \
cal-load alice.ics \
@ filter-merge \
@ filter-anonymize --all \
@ cal-save alice-public.ics
Union by occupied time ranges:
kiwimix \
cal-load alice.ics \
@ load bob.ics \
@ bool-union --ranges \
@ cal-save busy.ics
Compute free time slots by ranges:
kiwimix \
cal-load alice.ics \
@ cal-load bob.ics \
@ bool-union --ranges \
@ bool-substract --ranges \
@ cal-save free-time.ics
Find free time:
kiwimix \
cal-generate --from-date XXX --to-date YYY --from-time 9:00 --to-time 19:00 \
@ cal-load agenda.ics \
@ bool-substract --ranges \
@ cal-save free.ics
Find free time for a meeting:
kiwimix \
cal-generate --from-date XXX --to-date YYY --from-time 9:00 --to-time 19:00 \
@ cal-load alice.ics \
@ cal-load bob.ics \
@ bool-union --ranges \
@ bool-substract --ranges \
@ cal-save free.ics
Rewrite events:
kiwimix \
cal-load alice.ics \
@ filter-merge \
@ filter-anonymize --all \
@ cal-save alice-public.ics
Stack chain example (formerly noted as V2):
kiwimix \
cal-generate --from-date XXX --to-date YYY --from-time 9:00 --to-time 19:00 \
@ cal-load alice.ics \
@ filter-merge \
@ filter-anonymize --all \
@ cal-load bob.ics \
@ filter-merge \
@ filter-anonymize --all \
@ bool-union --ranges \
@ bool-substract --ranges \
@ cal-save result.ics
CLI model
- The stack holds calendars in memory.
- Operators pop one or two calendars and push the result back.
stack-swapandstack-droponly operate on the stack (no files).- Preflight validation enforces that the pipeline ends with an empty stack.
Operator reference
- Overview: `[docs/overview.md]
Format conventions
- Dates:
YYYY-MM-DD - Times:
H:MMorHH:MM(24h) - For
loadandsave,-means stdin/stdout. - Supported formats:
ICS(default),JSON(case-insensitive). - If
--formatis omitted, the format is inferred from the file extension. - When using stdin/stdout (
-), the format defaults toICSunless specified.
Installation
Build and install from source:
make prepare
make build
make install
Install with Go directly:
go install ./...
Build and test
Build binaries and templates:
make build
Run tests:
make test
References
Contributing
FIXME: Contributing guidelines are not yet documented. Please open an issue to discuss changes or submit a PR with context and tests where applicable.
License
GNU GPL-3.0