Add support to allow the week day start in cal to be configured via a flag (#1996)

* Add support to allow the week day start in cal to be configurable

* Fix variable name

* Use a flag instead of a configuration setting for specifying the starting day of the week
This commit is contained in:
Joseph T. Lyons
2020-06-18 13:34:51 -04:00
committed by GitHub
parent 96d58094cf
commit 353b33be1b
3 changed files with 78 additions and 13 deletions

View File

@ -8,6 +8,7 @@ Use `cal` to display a calendar.
* `-q`, `--quarter`: Display the quarter column
* `-m`, `--month`: Display the month column
* `--full-year` \<integer>: Display a year-long calendar for the specified year
* `--week-start` \<string>: Display the calendar with the specified day as the first day of the week
* `--month-names`: Display the month names instead of integers
## Examples
@ -188,3 +189,16 @@ Use `cal` to display a calendar.
12020 │ november │ 891011121314
───┴──────┴──────────┴────────┴────────┴─────────┴───────────┴──────────┴────────┴──────────
```
```shell
> cal -ymq --month-names --week-start-day monday
───┬──────┬─────────┬───────┬────────┬─────────┬───────────┬──────────┬────────┬──────────┬────────
# │ year │ quarter │ month │ monday │ tuesday │ wednesday │ thursday │ friday │ saturday │ sunday
───┼──────┼─────────┼───────┼────────┼─────────┼───────────┼──────────┼────────┼──────────┼────────
020202 │ june │ 1234567
120202 │ june │ 891011121314
220202 │ june │ 15161718192021
320202 │ june │ 22232425262728
420202 │ june │ 2930 │ │ │ │ │
───┴──────┴─────────┴───────┴────────┴─────────┴───────────┴──────────┴────────┴──────────┴────────
```