Daniel@0: .\" Copyright (c) 2002 Marcus Harnisch Daniel@0: .\" Daniel@0: .\" This is free documenation. It is provided to you without any Daniel@0: .\" warranty that it is useful or that you can understand it. Daniel@0: .\" Daniel@0: .\" You are granted the right to use and redistribute the source code Daniel@0: .\" or parts of it (even single words and letters), provided that the Daniel@0: .\" copyright notice and the license terms will not be removed. Daniel@0: .\" Daniel@0: .TH prune 1 Daniel@0: Daniel@0: .SH NAME Daniel@0: prune \- Prune directed graphs Daniel@0: .SH SYNOPSIS Daniel@0: .B prune Daniel@0: [ Daniel@0: .BI \-n " node" Daniel@0: ] Daniel@0: [ Daniel@0: .BI \-N " attrspec" Daniel@0: ] Daniel@0: [ Daniel@0: .I files ... Daniel@0: ] Daniel@0: .SH DESCRIPTION Daniel@0: .B prune Daniel@0: reads directed graphs in the same format used by Daniel@0: .B dot(1) Daniel@0: and removes subgraphs rooted at nodes specified on the Daniel@0: command line via options. These nodes themselves will not be removed, Daniel@0: but can be given attributes so that they can be easily located by a Daniel@0: graph stream editor such as Daniel@0: .B gpr(1). Daniel@0: .B prune Daniel@0: correctly handles cycles, loops and multi\(hyedges. Daniel@0: Daniel@0: Both options can appear multiple times on the command line. All Daniel@0: subgraphs rooted at the respective nodes given will then be Daniel@0: processed. If a node does not exist, Daniel@0: .B prune Daniel@0: will skip it and print a warning message to stderr. Daniel@0: If multiple attributes are given, they will be applied to Daniel@0: all nodes that have been processed. Daniel@0: .B prune Daniel@0: writes the result to the stdout. Daniel@0: .SH OPTIONS Daniel@0: .TP Daniel@0: .BI \-n " name" Daniel@0: Specifies name of node to prune. Daniel@0: .TP Daniel@0: .BI \-N " attrspec" Daniel@0: Specifies attribute that will be set (or changed if it exists) for any Daniel@0: pruned node. Daniel@0: .I attrspec Daniel@0: is a string of the form Daniel@0: .IR attr "=" value. Daniel@0: Daniel@0: .SH EXAMPLES Daniel@0: An input graph Daniel@0: .I test.dot Daniel@0: of the form Daniel@0: .PP Daniel@0: digraph DG { Daniel@0: .br Daniel@0: A \-> B; Daniel@0: .br Daniel@0: A \-> C; Daniel@0: .br Daniel@0: Daniel@0: .br Daniel@0: B \-> D; Daniel@0: .br Daniel@0: B \-> E; Daniel@0: .br Daniel@0: } Daniel@0: .br Daniel@0: Daniel@0: , processed by the command Daniel@0: .PP Daniel@0: prune \-n B test.dot Daniel@0: .PP Daniel@0: would produce the following output (the actual code might be formatted Daniel@0: in a slightly different way). Daniel@0: .PP Daniel@0: digraph DG { Daniel@0: .br Daniel@0: A \-> B; Daniel@0: .br Daniel@0: A \-> C; Daniel@0: .br Daniel@0: } Daniel@0: .br Daniel@0: Daniel@0: Another input graph Daniel@0: .I test.dot Daniel@0: of the form Daniel@0: .PP Daniel@0: digraph DG { Daniel@0: .br Daniel@0: A \-> B; Daniel@0: .br Daniel@0: A \-> C; Daniel@0: .br Daniel@0: Daniel@0: .br Daniel@0: B \-> D; Daniel@0: .br Daniel@0: B \-> E; Daniel@0: .br Daniel@0: Daniel@0: .br Daniel@0: C \-> E; Daniel@0: .br Daniel@0: } Daniel@0: .br Daniel@0: Daniel@0: (note the additional edge from Daniel@0: .I C Daniel@0: to Daniel@0: .I E Daniel@0: ), processed by the command Daniel@0: .PP Daniel@0: prune \-n B \-N color=red test.dot Daniel@0: .PP Daniel@0: results in Daniel@0: .PP Daniel@0: digraph DG { Daniel@0: .br Daniel@0: B [color=red]; Daniel@0: .br Daniel@0: A \-> B; Daniel@0: .br Daniel@0: A \-> C; Daniel@0: .br Daniel@0: C \-> E; Daniel@0: .br Daniel@0: } Daniel@0: .br Daniel@0: Daniel@0: Node Daniel@0: .I E Daniel@0: has not been removed since its second parent Daniel@0: .I C Daniel@0: is not being pruned. Daniel@0: Daniel@0: .SH "EXIT STATUS" Daniel@0: .B prune Daniel@0: returns 0 on successful completion. Daniel@0: It returns 1 if an error occurs. Daniel@0: .SH SEE ALSO Daniel@0: .BR dot (1), Daniel@0: .BR gpr (1) Daniel@0: Daniel@0: .SH AUTHOR Daniel@0: Marcus Harnisch