13 Dec 2012 eMBee   » (Journeyer)

a replacement for the cal commandline tool in pike

cal is a commandline tool to display a monthly or yearly calendar. It's convenient to use for lookup when there is no gui at hand.

It has a few limitations and irritations however. The most annoying one is that whenever i want to display a different month i have to enter a year as well. If you enter cal 2 it will display the year number 2, and not the month that i'd expect.

This pike version of cal fixes that. If you enter a number small enough to be a month then it will display the corresponding month of the current year.

The pike version has other features too. Thanks to pikes extensive calendar support, cal.pike can handle calendars other than the gregorian calendar. You can see a list of supported calendars in the pike module reference. To use a different calendar, just enter the name of the calendar as a first argument. The only calender from that list that doesn't work is Stardate because that doesn't have any months.

Further, motivated by this calendar task on rosettacode.org i have added support for varying terminal sizes. The program will check the calendar in an optimal with for the terminal. For a calendar with 12 months this means it will either fit as 2x6, 3x4, 4x3 or 6x2 rows and columns. The pike version for that task is btw only the year display. Support for showing a month and other stuff has been removed.

Other features: pikes calendar system supports events to mark holidays. Days that fall on an event are displayed in green. It is possible to choose events by region.

cal.pike is available under the GNU GPL v3. You can download it here

Syndicated 2012-01-05 16:35:06 from DevLog

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!