add argument/usage message, correct exit status
[unix-history] / usr / src / usr.bin / tsort / tsort.1
CommitLineData
07d825db
KB
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
d8e69841 3.\"
07d825db
KB
4.\" This manual is derived from one contributed to Berkeley by
5.\" Michael Rendell of Memorial University of Newfoundland.
6.\"
7.\" %sccs.include.redist.man%
8.\"
9.\" @(#)tsort.1 6.2 (Berkeley) %G%
10.\"
11.TH tsort 1 ""
d8e69841
KM
12.AT 3
13.SH NAME
07d825db 14tsort \- topological sort of a directed graph
d8e69841 15.SH SYNOPSIS
07d825db
KB
16.nf
17.ft B
18tsort [ file ]
19.ft R
20.fi
d8e69841
KM
21.SH DESCRIPTION
22.I Tsort
07d825db
KB
23takes a list of pairs of node names representing directed arcs in
24a graph and prints the nodes in topological order on standard output.
25Input is taken from the named file, or from standard input if no file
26is given.
27.PP
28Node names in the input are separated by white space and there must be an
29even number of nodes.
30.PP
31Presence of a node in a graph can be represented by an arc from the node
32to itself.
33This is useful when a node is not connected to any other nodes.
d8e69841 34.PP
07d825db
KB
35If the graph contains a cycle (and therefore cannot be properly sorted),
36one of the arcs in the cycle is ignored and the sort continues.
37Cycles are reported on standard error.