summaryrefslogtreecommitdiff
path: root/Base/usr/share/man/man1/cal.md
AgeCommit message (Collapse)Author
2023-04-25cal: Add the `-y` option to show the current yearKarol Baraniecki
Without `-y`, to show the current full year you'd have to specify which one: `cal 2023`. Adding `-y` makes it possible to see the full current year without remembering what year we are in. This option is also stolen from FreeBSD :^) Additionally, validate args: prevent passing both -3 and -y at the same time. Passing both `--three-month-mode` and `--year` to `cal` doesn't make sense. You'd either want the one or the other.
2023-04-25cal: Add the `-3` optionKarol Baraniecki
This allows to view just the previous, current, and next month simultaneously. The idea for this is shamelessly stolen from FreeBSD :^)
2023-04-25cal: Get default week start day from CalendarKarol Baraniecki
Making it configurable in system settings :^) The --start-day option can still overwrite this global default. This change makes it no longer possible to use unveil: as we have to load the Calendar config file, which might be in a dynamic location. It's also neccessary to add `cpath` to the pledge, as opening a nonexistent config file with Core::ConfigFile::open_for_app creates it.
2023-04-25cal: Make start of the week configurableKarol Baraniecki
Making all the other parts of the world happier :^) Add a `--starting-day` (`-s`) option to be compatible with GNU cal, which has a similar option. The GNU option takes allows passing either an int or a day name. Let's do something similar using weekdays we already have in AK/DateConstants.h. Also add myself to the copyright header, as by now I've modified most of the lines in this file.
2023-04-25cal: Only show year next to each month in one-month-modeKarol Baraniecki
Additionally rename a loop variable in serenity_main() because after introducing the `Header` enum IMO it's less readable with `i`.
2023-04-25cal: Display month namesKarol Baraniecki
For now let's use them from AK/DateConstants.h, in accordance with the FIXME those propably should be provided by the locale.
2023-04-25cal: Mark the current day as inverted textKarol Baraniecki
...instead of putting a star `*` next to it. This makes `cal`s output much prettier, and gets rid of one FIXME. :^) Don't use the escape sequence from the deleted FIXME - \e[30;47m would set the background to white and foreground to black - which presumably wouldn't do much on a light-theme terminal. Instead use \e[7m which sets the color as "inverted".
2023-04-25cal: Don't accept passing a [day]Karol Baraniecki
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`.
2019-12-24Docs: Add cal(1) man pageAndrés Vieira