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