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