Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cal: improve formatting for -y mode #242

Merged
merged 2 commits into from
Sep 13, 2023
Merged

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Sep 13, 2023

  • "cal -y" wastes space, printing one month at a time vertically
  • Output three months at a time, as done in OpenBSD cal (this fits into 80 columns for old terminals)
  • Convert print_month() into fmt_month(), returning a string
  • In -y mode the year appears once in a header line, not next to a month name
  • Future direction: possibly reduce lines of code by returning a list of strings in fmt_month()

* "cal -y" wastes space, printing one month at a time vertically
* Output three months at a time, as done in OpenBSD cal (this fits into 80 columns for old terminals)
* Convert print_month() into fmt_month(), returning a string
* In -y mode the year appears once in a header line, not next to a month name
* Future direction: possibly reduce lines of code by returning a list of strings in fmt_month()
@briandfoy briandfoy self-assigned this Sep 13, 2023
@briandfoy briandfoy added Priority: low get to this whenever Program: cal The cal program Type: enhancement improve a feature that already exists Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Sep 13, 2023
@briandfoy briandfoy merged commit c3f4019 into briandfoy:master Sep 13, 2023
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: cal The cal program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants