Skip to content

Commit d090f5d

Browse files
committed
- [#] the -cfg functionality implemented
1 parent dbcc464 commit d090f5d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

structEnc.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"embed"
55
"encoding/json"
6+
"io/ioutil"
67
"log"
78
)
89

@@ -50,6 +51,12 @@ func initDefaults() {
5051
}
5152

5253
func getDefault() {
54+
if Opts.Cfg != "" {
55+
data, err := ioutil.ReadFile(Opts.Cfg)
56+
checkError(err)
57+
err = json.Unmarshal(data, &Defaults)
58+
checkError(err)
59+
}
5360
if encDefault, ok := Defaults[Opts.Target]; ok {
5461
// debug(encDefault.Ext, 2)
5562
Opts.Encoding = encDefault

0 commit comments

Comments
 (0)