1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:27:46 +00:00

cal: Don't accept passing a [day]

Every other cal implementation just highlights the current day instead
of letting you specify a custom one to highlight. It doesn't seem to be
that useful, and is currently broken - no day gets highlighted at all,
because the `target_day` global is never written to.

Moreover, this complicates parsing the arguments. This commit also fixes
parsing a case where just a year is provided to `cal` - for example `cal
2023`.
This commit is contained in:
Karol Baraniecki 2023-02-23 16:53:40 +01:00 committed by Andrew Kaster
parent f5cb46e316
commit b57c718418
2 changed files with 8 additions and 11 deletions

View file

@ -5,12 +5,13 @@ cal - Display a calendar
## Synopsis
```**sh
$ cal [[[day] month] year]
$ cal [[month] year]
```
## Description
This program displays a simple calendar. If no arguments are specified, the current month is displayed with the current day highlighted.
An overview of a whole year is displayed when a `year` is passed without a `month`.
Days, months and years are specified with numbers. Week starts at Sunday.