.TH tsort "" "" Command
.PC "Topological sort"
\fBtsort [\fIfile\^\fB]\fR
.PP
.B tsort
performs a topological sort of a set of input items.
The input
.I file
(or the standard input, if no
.I file
is given) specifies an ordering on pairs of items.
It consists of pairs of items separated by blanks, tabs or newlines.
If a pair contains the same item twice, it
simply indicates that the item is in the input set.
Otherwise, the pair indicates that the first item precedes
the second in the ordering.
.PP
.B tsort
prints a sorted list of the input items on the standard output.
.SH "See Also"
.Xr "commands," commands
.Xr "sort" sort
.SH Diagnostics
.B tsort
prints an error message on the standard error if its input
contains an odd number of items or if the specified
ordering includes a cycle.
