-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
53 lines (43 loc) · 1.2 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package splitter
import (
cfg "github.com/digisan/go-config"
"github.com/gosuri/uiprogress"
)
var (
uip *uiprogress.Progress
bar *uiprogress.Bar
procSize uint64
progBar = true
enableTrim bool
enableSplit bool
inFolder string
inFolderAbs string
goSubFolder bool
bySplit2 bool
ignoreFolder4Split string
out4Split string
splitSchema []string
trimColAfterSplit bool
trimCols []string
out4Trim string
merges []map[string]any
)
func init() {
// setConfig("./config.toml", "../config.toml")
}
func setConfig(fConfigs ...string) {
cfg.Init("config", false, fConfigs...)
inFolder = cfg.Path("InFolder")
inFolderAbs = cfg.PathAbs("InFolder")
goSubFolder = cfg.Bool("WalkSubFolders")
trimColAfterSplit = cfg.Bool("TrimColAfterSplit")
enableTrim = cfg.Bool("Trim.Enabled")
trimCols = cfg.Strs("Trim.Columns")
out4Trim = cfg.Path("Trim.OutFolder")
enableSplit = cfg.Bool("Split.Enabled")
bySplit2 = cfg.Bool("Split.SplitVer2")
ignoreFolder4Split = cfg.Path("Split.IgnoreFolder")
out4Split = cfg.Path("Split.OutFolder")
splitSchema = cfg.Strs("Split.Schema")
merges = cfg.Objects("Merge")
}