You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: main.go
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,6 @@ package main
2
2
3
3
import (
4
4
"fmt"
5
-
"sync"
6
5
"errors"
7
6
"bytes"
8
7
"io/ioutil"
@@ -11,6 +10,7 @@ import (
11
10
"strings"
12
11
"regexp"
13
12
flags "github.com/jessevdk/go-flags"
13
+
"github.com/remeh/sizedwaitgroup"
14
14
)
15
15
16
16
const (
@@ -38,6 +38,7 @@ type fileitem struct {
38
38
}
39
39
40
40
varoptsstruct {
41
+
ThreadCountint` long:"threads" description:"Set thread concurrency for replacing in multiple files at same time" default:"10"`
41
42
Modestring`short:"m" long:"mode" description:"replacement mode - replace: replace match with term; line: replace line with term; lineinfile: replace line with term or if not found append to term to file; template: parse content as golang template, search value have to start uppercase" default:"replace" choice:"replace" choice:"line" choice:"lineinfile" choice:"template"`
0 commit comments