Skip to content

Commit 540a0e7

Browse files
committed
add WithServerInstructions to builder
1 parent 61be0e1 commit 540a0e7

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

pkg/inventory/builder.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ type Builder struct {
3333
deprecatedAliases map[string]string
3434

3535
// Configuration options (processed at Build time)
36-
readOnly bool
37-
toolsetIDs []string // raw input, processed at Build()
38-
toolsetIDsIsNil bool // tracks if nil was passed (nil = defaults)
39-
additionalTools []string // raw input, processed at Build()
40-
featureChecker FeatureFlagChecker
41-
filters []ToolFilter // filters to apply to all tools
36+
readOnly bool
37+
toolsetIDs []string // raw input, processed at Build()
38+
toolsetIDsIsNil bool // tracks if nil was passed (nil = defaults)
39+
additionalTools []string // raw input, processed at Build()
40+
featureChecker FeatureFlagChecker
41+
filters []ToolFilter // filters to apply to all tools
42+
generateInstructions bool
4243
}
4344

4445
// NewBuilder creates a new Builder.
@@ -83,6 +84,11 @@ func (b *Builder) WithReadOnly(readOnly bool) *Builder {
8384
return b
8485
}
8586

87+
func (b *Builder) WithServerInstructions() *Builder {
88+
b.generateInstructions = true
89+
return b
90+
}
91+
8692
// WithToolsets specifies which toolsets should be enabled.
8793
// Special keywords:
8894
// - "all": enables all toolsets
@@ -161,6 +167,10 @@ func (b *Builder) Build() *Inventory {
161167
}
162168
}
163169

170+
if b.generateInstructions {
171+
r.instructions = generateInstructions(r.EnabledToolsetIDs())
172+
}
173+
164174
return r
165175
}
166176

0 commit comments

Comments
 (0)