A Go port of the tsort
utility from GNU Coreutils.
It performs a topological sort using Algorithm T from Knuth's The Art of Computer Programming, Volume 1.
tsort-go [OPTION] [FILE]
Write totally ordered list consistent with the partial ordering in FILE. With no FILE, or when FILE is -
, read standard input.
tsort-go <<EOF
a b c
d
e f
b c d e
EOF
will produce the output
a
b
c
d
e
f
For detailed information on the tsort
command invocation, see the GNU Coreutils manual.
GPL-3.0