.TH SCHED 1carl CARL
.SH NAME
sched \- find common hours for meeting times
.SH SYNOPSIS
.B sched 
[ -p[X] ] [ [ [ day ] [ from ] ] [ to ] ] < schedules > merged_schedules
.SH DESCRIPTION
flag:
.TP
.B -p
print individual schedules,
If X is supplied, print schedule 
for participant named X
.PP
Without optional
.I day, from
and
.I to
arguments,
.B sched
prints a calendar.
Optional
.I day, from
and
.I to
arguments
indicate a sub-group of interesting hours, and cause a list of
participants who can attend during those hours to be printed.  
Note:
.I day, from
and
.I to
arguments are not flags.
.PP
.B sched
reads in text descriptions of schedules.  It analyzes them for times
in common, and prints a list of the hours when everyone is free.
.PP
The schedule format which 
.B sched
reads from its standard input is as follows:
.RS .5i
.nf
<name>
[[<day_of_week>] [from_hour to_hour] ... ]
.  .  .
<name>
[[<day_of_week>] [from_hour to_hour] ... ]
.  .  .
.RE
.fi
where 
.I <name> 
is the name of the person whose schedule follows.  (Note: names must
consist of only one word.  See BUGS below).
.I <day_of_week>
is at least three characters specifying the day (the first letter may
be upper or lower case, the rest must be lower case).
The day is followed by any number of
.I <from_hour> <to_hour>
pairs which supply a range of hours for which that person is available
on that day.  
The input format must specify hours in 24-hour time format.
Any number of 
.I <day_of_week> 
lines may follow a 
.I <name>.
It is assumed that for days not mentioned for a person
the person is not available that whole day.
The schedules of all participants to be compared are supplied one after
the other.
.PP
Ordinarily, the output of 
.B sched
is a 24-hour, seven day calendar.  The calendar has asterisks ('*')
for times when all parties can meet.  Otherwise, the number of
participants who can attend at a given hour is printed.  If the number
is zero, a vertical bar is printed (simply to help read the calendar).
.PP
The 
.I p
flag causes 
.B sched
to print the calendars it compiles for the individual participants.
If the
.I p
flag has a name of one of the participants concatenated to it, just
the calendar for that person is printed.
.PP
If any of the optional
.I day, from
and
.I to
arguments are supplied on the command line, 
.B sched
takes this as a sub-group of time to examine.  
These values are in the same format as for the schedules.
The names of the
participants who can meet during that time interval are listed.  
Also listed is
an indication of how many of the hours within that duration they can
attend.  If just a 
.I day 
is given, the whole day is examined.  If just a
.I from
is added to this, the day from that time until midnight is examined.
.SH USAGE
First compile a schedule file.  To examine 
.B sched
\'s
analysis of the schedules, use the 
.I -p 
flag to list them all.  Name a person after the flag (e.g., 
.I -pgareth)
to just see that person's schedule.
Omit all arguments to get a meeting calendar.
To examine a range of hours to see who can come during a particular
time slot, give the 
.I day, from
and
.I to
times in question.
To examine an entire day this way, just mention the day.
.SH AUTHOR
Gareth Loy
.SH DIAGNOSTICS
The message
``day expected on line X''
indicates that either the day on line X was misspelled, or that
a <from_hour> specification appeared without a corresponding <to_hour>
on the previous line.
The message
``range format error on line X'',
indicates that a <to_hour> specification on line X was greater than
or equal to its corresponding <from_hour> specification.
This can occur, for instance, when hours are mistakenly
specified in 12-hour format.
The message
``too many participants!''
indicates that you have tried to schedule more than 512 participants,
the current limit.
.SH BUGS
Names of participants are restricted to one word.
If you must use last names too, run them together with a non-blank
character, such as hyphen or underbar.
Hours must be specified in 24-hour format.
Quantization is to the hour, so it is of no use for really tightly
scheduled people.
If more than 99 people can attend during one time slot, the calendar
will become misaligned.
