MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / NewFromCLI

Function NewFromCLI

pkg/filter/filter_windows.go:111–121  ·  view source on GitHub ↗

NewFromCLI builds and compiles a filter by joining all the command line arguments into the filter expression.

(args []string, config *config.Config)

Source from the content-addressed store, hash-verified

109
110// NewFromCLI builds and compiles a filter by joining all the command line arguments into the filter expression.
111func NewFromCLI(args []string, config *config.Config) (Filter, error) {
112 expr := strings.Join(args, " ")
113 if expr == "" {
114 return nil, nil
115 }
116 filter := New(expr, config)
117 if err := filter.Compile(); err != nil {
118 return nil, fmt.Errorf("bad filter:\n%v", err)
119 }
120 return filter, nil
121}
122
123// NewFromCLIWithAllAccessors builds and compiles a filter with all field accessors enabled.
124func NewFromCLIWithAllAccessors(args []string) (Filter, error) {

Callers 2

RunMethod · 0.92
WriteCaptureMethod · 0.92

Calls 2

NewFunction · 0.70
CompileMethod · 0.65

Tested by

no test coverage detected