xref: /freebsd/usr.bin/ncal/ncal.1 (revision 8c108b341cd82d0ed9fcd573764bc94682e84125)
1*8c108b34SValentine Astakhov.\"-
2*8c108b34SValentine Astakhov.\" SPDX-License-Identifier: BSD-2-Clause
3*8c108b34SValentine Astakhov.\"
4cb0f03a1SWolfgang Helbig.\" Copyright (c) 1997 Wolfgang Helbig
5cb0f03a1SWolfgang Helbig.\" All rights reserved.
6cb0f03a1SWolfgang Helbig.\"
7cb0f03a1SWolfgang Helbig.\" Redistribution and use in source and binary forms, with or without
8cb0f03a1SWolfgang Helbig.\" modification, are permitted provided that the following conditions
9cb0f03a1SWolfgang Helbig.\" are met:
10cb0f03a1SWolfgang Helbig.\" 1. Redistributions of source code must retain the above copyright
11cb0f03a1SWolfgang Helbig.\"    notice, this list of conditions and the following disclaimer.
12cb0f03a1SWolfgang Helbig.\" 2. Redistributions in binary form must reproduce the above copyright
13cb0f03a1SWolfgang Helbig.\"    notice, this list of conditions and the following disclaimer in the
14cb0f03a1SWolfgang Helbig.\"    documentation and/or other materials provided with the distribution.
15cb0f03a1SWolfgang Helbig.\"
16cb0f03a1SWolfgang Helbig.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17cb0f03a1SWolfgang Helbig.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18cb0f03a1SWolfgang Helbig.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19cb0f03a1SWolfgang Helbig.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20cb0f03a1SWolfgang Helbig.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21cb0f03a1SWolfgang Helbig.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22cb0f03a1SWolfgang Helbig.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23cb0f03a1SWolfgang Helbig.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24cb0f03a1SWolfgang Helbig.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25cb0f03a1SWolfgang Helbig.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26cb0f03a1SWolfgang Helbig.\" SUCH DAMAGE.
27cb0f03a1SWolfgang Helbig.\"
28a832f42aSMateusz Piotrowski.Dd March 7, 2019
290cb2e609SWolfgang Helbig.Dt CAL 1
300cb2e609SWolfgang Helbig.Os
310cb2e609SWolfgang Helbig.Sh NAME
320cb2e609SWolfgang Helbig.Nm cal ,
330cb2e609SWolfgang Helbig.Nm ncal
34ba29aec0SGarrett Wollman.Nd displays a calendar and the date of Easter
350cb2e609SWolfgang Helbig.Sh SYNOPSIS
368fe908efSRuslan Ermilov.Nm
37*8c108b34SValentine Astakhov.Op Fl 3hjMy
38cae11c25SEdwin Groothuis.Op Fl A Ar number
39cae11c25SEdwin Groothuis.Op Fl B Ar number
40536e6834SRuslan Ermilov.Oo
41536e6834SRuslan Ermilov.Op Ar month
42536e6834SRuslan Ermilov.Ar year
43536e6834SRuslan Ermilov.Oc
440c4cafeaSGarrett Wollman.Nm
45*8c108b34SValentine Astakhov.Op Fl 3hjM
46cae11c25SEdwin Groothuis.Op Fl A Ar number
47cae11c25SEdwin Groothuis.Op Fl B Ar number
480c4cafeaSGarrett Wollman.Fl m Ar month
490c4cafeaSGarrett Wollman.Op Ar year
500cb2e609SWolfgang Helbig.Nm ncal
51cae11c25SEdwin Groothuis.Op Fl 3hjJpwy
52cae11c25SEdwin Groothuis.Op Fl A Ar number
53cae11c25SEdwin Groothuis.Op Fl B Ar number
54a99e4564SPhilippe Charnier.Op Fl s Ar country_code
55536e6834SRuslan Ermilov.Oo
56536e6834SRuslan Ermilov.Op Ar month
57536e6834SRuslan Ermilov.Ar year
58536e6834SRuslan Ermilov.Oc
590cb2e609SWolfgang Helbig.Nm ncal
60cae11c25SEdwin Groothuis.Op Fl 3hJeo
61cae11c25SEdwin Groothuis.Op Fl A Ar number
62cae11c25SEdwin Groothuis.Op Fl B Ar number
630cb2e609SWolfgang Helbig.Op Ar year
64531a1a4bSEdwin Groothuis.Nm ncal
65531a1a4bSEdwin Groothuis.Op Fl CN
66531a1a4bSEdwin Groothuis.Op Fl H Ar yyyy-mm-dd
67531a1a4bSEdwin Groothuis.Op Fl d Ar yyyy-mm
680cb2e609SWolfgang Helbig.Sh DESCRIPTION
69e8937ba0SPhilippe CharnierThe
70e8937ba0SPhilippe Charnier.Nm
71e8937ba0SPhilippe Charnierutility displays a simple calendar in traditional format and
720cb2e609SWolfgang Helbig.Nm ncal
73ba29aec0SGarrett Wollmanoffers an alternative layout, more options and the date of Easter.
740cb2e609SWolfgang HelbigThe new format is a little cramped but it makes a year fit
750cb2e609SWolfgang Helbigon a 25x80 terminal.
760cb2e609SWolfgang HelbigIf arguments are not specified,
770cb2e609SWolfgang Helbigthe current month is displayed.
78a99e4564SPhilippe Charnier.Pp
790cb2e609SWolfgang HelbigThe options are as follows:
80a99e4564SPhilippe Charnier.Bl -tag -width indent
817149aa01SRoman Divacky.It Fl h
827149aa01SRoman DivackyTurns off highlighting of today.
830cb2e609SWolfgang Helbig.It Fl J
840cb2e609SWolfgang HelbigDisplay Julian Calendar, if combined with the
850cb2e609SWolfgang Helbig.Fl e
86ba29aec0SGarrett Wollmanoption, display date of Easter according to the Julian Calendar.
870cb2e609SWolfgang Helbig.It Fl e
88ba29aec0SGarrett WollmanDisplay date of Easter (for western churches).
890cb2e609SWolfgang Helbig.It Fl j
90cb0f03a1SWolfgang HelbigDisplay Julian days (days one-based, numbered from January 1).
91*8c108b34SValentine Astakhov.It Fl M
92*8c108b34SValentine AstakhovDisplay Monday as the first day of the week in
93*8c108b34SValentine Astakhov.Nm cal
94*8c108b34SValentine Astakhovmode.
950c4cafeaSGarrett Wollman.It Fl m Ar month
960c4cafeaSGarrett WollmanDisplay the specified
970c4cafeaSGarrett Wollman.Ar month .
98ba29aec0SGarrett WollmanIf
99ba29aec0SGarrett Wollman.Ar month
100ba29aec0SGarrett Wollmanis specified as a decimal number, it may be followed by the letter
101ba29aec0SGarrett Wollman.Ql f
102ba29aec0SGarrett Wollmanor
103ba29aec0SGarrett Wollman.Ql p
104ba29aec0SGarrett Wollmanto indicate the following or preceding month of that number,
105ba29aec0SGarrett Wollmanrespectively.
1060cb2e609SWolfgang Helbig.It Fl o
107ba29aec0SGarrett WollmanDisplay date of Orthodox Easter (Greek and Russian
1080cb2e609SWolfgang HelbigOrthodox Churches).
1090cb2e609SWolfgang Helbig.It Fl p
110cb0f03a1SWolfgang HelbigPrint the country codes and switching days from Julian to Gregorian
1110cb2e609SWolfgang HelbigCalendar as they are assumed by
1120cb2e609SWolfgang Helbig.Nm ncal .
113cde26ed2SWolfgang HelbigThe country code as determined from the local environment is marked
114cde26ed2SWolfgang Helbigwith an asterisk.
115a99e4564SPhilippe Charnier.It Fl s Ar country_code
1160cb2e609SWolfgang HelbigAssume the switch from Julian to Gregorian Calendar at the date
1170cb2e609SWolfgang Helbigassociated with the
118a99e4564SPhilippe Charnier.Ar country_code .
1190cb2e609SWolfgang HelbigIf not specified,
1200cb2e609SWolfgang Helbig.Nm ncal
121cde26ed2SWolfgang Helbigtries to guess the switch date from the local environment or
1226a3e8b0aSRuslan Ermilovfalls back to September 2, 1752.
1236a3e8b0aSRuslan ErmilovThis was when Great
124cde26ed2SWolfgang HelbigBritain and her colonies switched to the Gregorian Calendar.
1250cb2e609SWolfgang Helbig.It Fl w
126cb0f03a1SWolfgang HelbigPrint the number of the week below each week column.
1270cb2e609SWolfgang Helbig.It Fl y
1280c4cafeaSGarrett WollmanDisplay a calendar for the specified year.
1290851fbdfSEdwin Groothuis.It Fl 3
1300851fbdfSEdwin GroothuisDisplay the previous, current and next month surrounding today.
1310851fbdfSEdwin Groothuis.It Fl A Ar number
1320851fbdfSEdwin GroothuisDisplay the
1330851fbdfSEdwin Groothuis.Ar number
1340851fbdfSEdwin Groothuisof months after the current month.
1350851fbdfSEdwin Groothuis.It Fl B Ar number
1360851fbdfSEdwin GroothuisDisplay the
1370851fbdfSEdwin Groothuis.Ar number
1380851fbdfSEdwin Groothuisof months before the current month.
139531a1a4bSEdwin Groothuis.It Fl C
140531a1a4bSEdwin GroothuisSwitch to
141531a1a4bSEdwin Groothuis.Nm cal
142531a1a4bSEdwin Groothuismode.
143531a1a4bSEdwin Groothuis.It Fl N
144531a1a4bSEdwin GroothuisSwitch to
145531a1a4bSEdwin Groothuis.Nm ncal
146531a1a4bSEdwin Groothuismode.
1474af997a8SEdwin Groothuis.It Fl d Ar yyyy-mm
1484af997a8SEdwin GroothuisUse
1494af997a8SEdwin Groothuis.Ar yyyy-mm
1504af997a8SEdwin Groothuisas the current date (for debugging of date selection).
1514af997a8SEdwin Groothuis.It Fl H Ar yyyy-mm-dd
1524af997a8SEdwin GroothuisUse
1534af997a8SEdwin Groothuis.Ar yyyy-mm-dd
1544af997a8SEdwin Groothuisas the current date (for debugging of highlighting).
1550cb2e609SWolfgang Helbig.El
1560cb2e609SWolfgang Helbig.Pp
157ba29aec0SGarrett WollmanA single parameter specifies the year (1\(en9999) to be displayed;
1580cb2e609SWolfgang Helbignote the year must be fully specified:
1590cb2e609SWolfgang Helbig.Dq Li cal 89
1600cb2e609SWolfgang Helbigwill
1610cb2e609SWolfgang Helbig.Em not
1627fe961ffSEitan Adlerdisplay a calendar for 1989.
1637fe961ffSEitan AdlerTwo parameters denote the month and
1640851fbdfSEdwin Groothuisyear; the month is either a number between 1 and 12, or a full or
1657fe961ffSEitan Adlerabbreviated name as specified by the current locale.
1667fe961ffSEitan AdlerMonth and
1670851fbdfSEdwin Groothuisyear default to those of the current system clock and time zone (so
1680c4cafeaSGarrett Wollman.Dq Li cal -m 8
1690851fbdfSEdwin Groothuiswill display a calendar for the month of August in the current
1700851fbdfSEdwin Groothuisyear).
1710cb2e609SWolfgang Helbig.Pp
1727fe961ffSEitan AdlerNot all options can be used together.
1737fe961ffSEitan AdlerFor example
1744af997a8SEdwin Groothuis.Dq Li -3 -A 2 -B 3 -y -m 7
1754af997a8SEdwin Groothuiswould mean:
1764af997a8SEdwin Groothuisshow me the three months around the seventh month, three before
1774af997a8SEdwin Groothuisthat, two after that and the whole year.
1784af997a8SEdwin Groothuis.Nm ncal
1794af997a8SEdwin Groothuiswill warn about these combinations.
1804af997a8SEdwin Groothuis.Pp
181ba29aec0SGarrett WollmanA year starts on January 1.
182608be0d0SEdwin Groothuis.Pp
183f379d691SEdwin GroothuisHighlighting of dates is disabled if stdout is not a tty.
1840cb2e609SWolfgang Helbig.Sh SEE ALSO
1850cb2e609SWolfgang Helbig.Xr calendar 3 ,
1860cb2e609SWolfgang Helbig.Xr strftime 3
187358952caSGreg Lehey.Sh STANDARDS
188358952caSGreg LeheyThe
189358952caSGreg Lehey.Nm
190358952caSGreg Leheyutility is compliant with the
191358952caSGreg LeheyX/Open System Interfaces option of the
192358952caSGreg Lehey.St -p1003.1-2008
193358952caSGreg Leheyspecification.
194358952caSGreg Lehey.Pp
195358952caSGreg LeheyThe flags
196*8c108b34SValentine Astakhov.Op Fl 3ehJMopwy ,
197358952caSGreg Leheyas well as the ability to specify a month name as a single argument,
198358952caSGreg Leheyare extensions to that specification.
199358952caSGreg Lehey.Pp
200358952caSGreg LeheyThe week number computed by
201358952caSGreg Lehey.Fl w
202358952caSGreg Leheyis compliant with the
203358952caSGreg Lehey.St -iso8601
204358952caSGreg Leheyspecification.
2050cb2e609SWolfgang Helbig.Sh HISTORY
2060cb2e609SWolfgang HelbigA
2078fe908efSRuslan Ermilov.Nm
2080cb2e609SWolfgang Helbigcommand appeared in
2097fe961ffSEitan Adler.At v1 .
2100cb2e609SWolfgang HelbigThe
2110cb2e609SWolfgang Helbig.Nm ncal
212f24a941bSPoul-Henning Kampcommand appeared in
213f24a941bSPoul-Henning Kamp.Fx 2.2.6 .
214306005e7SPhilippe Charnier.Sh AUTHORS
215f24a941bSPoul-Henning KampThe
216f24a941bSPoul-Henning Kamp.Nm ncal
217f24a941bSPoul-Henning Kampcommand and manual were written by
2182b7af31cSBaptiste Daroussin.An Wolfgang Helbig Aq Mt helbig@FreeBSD.org .
219cde26ed2SWolfgang Helbig.Sh BUGS
2200851fbdfSEdwin GroothuisThe assignment of Julian\(enGregorian switching dates to country
2210851fbdfSEdwin Groothuiscodes is historically naive for many countries.
2221d0e1dacSEdwin Groothuis.Pp
2231d0e1dacSEdwin GroothuisNot all options are compatible and using them in different orders
2241d0e1dacSEdwin Groothuiswill give varying results.
225