@@ -29,14 +29,19 @@ func Main(options ...func(o *Options)) error { //nolint:funlen,cyclop,gocognit,g
2929 r := & runner {}
3030
3131 flag .Var (flagFunc (func (v string ) error {
32- r .filters = append (r .filters , filter {pass : true , ms : v , and : bytes .Split ([]byte (v ), []byte ("^" ))})
32+ r .filters = append (r .filters , filter {pass : true , and : bytes .Split ([]byte (v ), []byte ("^" ))})
3333
3434 return nil
3535 }), "pass" , "filter matching, may contain multiple AND patterns separated by ^,\n " +
3636 "if filter matches, line is passed to the output (may be filtered out by preceding -skip)\n " +
3737 "other -pass values are evaluated if preceding pass/skip did not match,\n " +
3838 "for example, you can use \" -pass bar^baz -pass foo -skip fo\" to only keep lines that have (bar AND baz) OR foo, but not fox" )
3939
40+ flag .Var (flagFunc (func (v string ) error {
41+ return r .loadCSVFilter (v , true )
42+ }), "pass-csv" , "filter matching, loads pass params from CSV file,\n " +
43+ "each line is treated as -pass, each column value is AND condition." )
44+
4045 flag .BoolFunc ("pass-any" , "finishes matching and gets the value even if previous -pass did not match,\n " +
4146 "if previous -skip matched, the line would be skipped any way." , func (s string ) error {
4247 r .filters = append (r .filters , filter {pass : true })
@@ -45,7 +50,12 @@ func Main(options ...func(o *Options)) error { //nolint:funlen,cyclop,gocognit,g
4550 })
4651
4752 flag .Var (flagFunc (func (v string ) error {
48- r .filters = append (r .filters , filter {pass : false , ms : v , and : bytes .Split ([]byte (v ), []byte ("^" ))})
53+ return r .loadCSVFilter (v , false )
54+ }), "skip-csv" , "filter matching, loads skip params from CSV file,\n " +
55+ "each line is treated as -skip, each column value is AND condition." )
56+
57+ flag .Var (flagFunc (func (v string ) error {
58+ r .filters = append (r .filters , filter {pass : false , and : bytes .Split ([]byte (v ), []byte ("^" ))})
4959
5060 return nil
5161 }), "skip" , "filter matching, may contain multiple AND patterns separated by ^,\n " +
0 commit comments