-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
39 lines (31 loc) · 911 Bytes
/
main.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
package main
import (
"racfudit/common"
"racfudit/db"
)
func main() {
// Parse options and configure log file
common.ParseFlags()
if err := common.Opt.Check(); err != nil {
common.Fatal(err)
}
if err := common.Opt.Logger(); err != nil {
common.Fatal(err)
}
defer common.Log.Close()
// Parse RACF DB and extract profiles (init runtime DB)
// profileStructs contains map of dinamic structure for RACF profiles
profileStructs, profiles, err := db.ParseRACF(common.Opt.RACFFile)
if err != nil {
common.Fatal(err)
}
// Save runtime DB as plaint text
if len(common.Opt.DumpFile) > 0 {
db.ToPlainText(profiles, common.Opt.DumpFile)
}
// Save runtime DB as sqlite3 DB
if len(common.Opt.SqlFile) > 0 {
db.ToSQLite(profiles, common.Opt.SqlFile, profileStructs)
}
common.Log.Info("Done")
}