Skip to content

Commit e5859cd

Browse files
committed
fixed typos and renamed Recursion to Depth
1 parent c5ad84a commit e5859cd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cmd/bom/cmd/document_todot.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ func AddToDot(parent *cobra.Command) {
2828
toDotOpts := &spdx.ToDotOptions{}
2929
toDotCmd := &cobra.Command{
3030
PersistentPreRunE: initLogging,
31-
Short: "bom document todot -> dump the structure of the a SPDX document as dotlang.",
32-
Long: `bom document todot -> dump the structure of the a SPDX document as dotlang.
31+
Short: "bom document todot -> dump the SPDX document as dotlang.",
32+
Long: `bom document todot -> dump the SPDX document as dotlang.
3333
3434
This Subcommand translates the graph like structure of an spdx document into dotlang,
3535
An abstract grammar used to represent graphs https://graphviz.org/doc/info/lang.html.
@@ -55,7 +55,7 @@ bom will try to add useful information to dotlangs tooltip node attribute.
5555
return fmt.Errorf("opening doc: %w", err)
5656
}
5757
if toDotOpts.Find != "" {
58-
doc.FilterReverseDependencies(toDotOpts.Find, toDotOpts.Recursion)
58+
doc.FilterReverseDependencies(toDotOpts.Find, toDotOpts.Depth)
5959
}
6060
fmt.Println(doc.ToDot(toDotOpts))
6161
return nil
@@ -69,7 +69,7 @@ bom will try to add useful information to dotlangs tooltip node attribute.
6969
"Find node in DAG",
7070
)
7171
toDotCmd.PersistentFlags().IntVarP(
72-
&toDotOpts.Recursion,
72+
&toDotOpts.Depth,
7373
"depth",
7474
"d",
7575
-1,
@@ -80,7 +80,7 @@ bom will try to add useful information to dotlangs tooltip node attribute.
8080
"subgraph",
8181
"s",
8282
"",
83-
"SPXID of the root node for the subgraph",
83+
"SPDXID of the root node for the subgraph",
8484
)
8585
parent.AddCommand(toDotCmd)
8686
}

pkg/spdx/document.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ type ExternalRef struct {
122122

123123
type ToDotOptions struct {
124124
Find string
125-
Recursion int
125+
Depth int
126126
SubGraphRoot string
127127
}
128128

@@ -301,7 +301,7 @@ func (d *Document) ToDot(o *ToDotOptions) string {
301301
} else {
302302
out += escape(d.Name) + " -> " + escape(p.SPDXID()) + ";\n"
303303
}
304-
out += toDot(p, o.Recursion, seenFilter)
304+
out += toDot(p, o.Depth, seenFilter)
305305
}
306306
return fmt.Sprintf("digraph {\n%s\n}\n", out)
307307
}

0 commit comments

Comments
 (0)