1prune(1) General Commands Manual prune(1)
2
3
4
6 prune - Prune directed graphs
7
9 prune [ -n node ] [ -N attrspec ] [ files ... ]
10
12 prune reads directed graphs in the same format used by dot(1) and
13 removes subgraphs rooted at nodes specified on the command line via
14 options. These nodes themselves will not be removed, but can be given
15 attributes so that they can be easily located by a graph stream editor
16 such as gpr(1). prune correctly handles cycles, loops and multi-edges.
17
18 Both options can appear multiple times on the command line. All sub‐
19 graphs rooted at the respective nodes given will then be processed. If
20 a node does not exist, prune will skip it and print a warning message
21 to stderr. If multiple attributes are given, they will be applied to
22 all nodes that have been processed. prune writes the result to the
23 stdout.
24
26 -n name
27 Specifies name of node to prune.
28
29 -N attrspec
30 Specifies attribute that will be set (or changed if it exists)
31 for any pruned node. attrspec is a string of the form
32 attr=value.
33
34
36 An input graph test.dot of the form
37
38 digraph DG {
39 A -> B;
40 A -> C;
41
42 B -> D;
43 B -> E;
44 }
45
46 , processed by the command
47
48 prune -n B test.dot
49
50 would produce the following output (the actual code might be formatted
51 in a slightly different way).
52
53 digraph DG {
54 A -> B;
55 A -> C;
56 }
57
58 Another input graph test.dot of the form
59
60 digraph DG {
61 A -> B;
62 A -> C;
63
64 B -> D;
65 B -> E;
66
67 C -> E;
68 }
69
70 (note the additional edge from C to E ), processed by the command
71
72 prune -n B -N color=red test.dot
73
74 results in
75
76 digraph DG {
77 B [color=red];
78 A -> B;
79 A -> C;
80 C -> E;
81 }
82
83 Node E has not been removed since its second parent C is not being
84 pruned.
85
86
88 prune returns 0 on successful completion. It returns 1 if an error
89 occurs.
90
92 dot(1), gpr(1)
93
94
96 Marcus Harnisch <marcus.harnisch@gmx.net>
97
98
99
100 prune(1)